explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KQjR7

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 742.308 ↓ 0.0 0 1

Gather Merge (cost=28,727.23..28,764.33 rows=318 width=175) (actual time=736.399..742.308 rows=0 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 0.213 2,192.226 ↓ 0.0 0 3

Sort (cost=27,727.20..27,727.60 rows=159 width=175) (actual time=730.742..730.742 rows=0 loops=3)

  • Sort Key: herald_activity."timestamp" DESC, herald_activity.id DESC
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
3. 1,326.210 2,192.013 ↓ 0.0 0 3

Parallel Hash Join (cost=9,704.39..27,721.39 rows=159 width=175) (actual time=730.671..730.671 rows=0 loops=3)

  • Hash Cond: (herald_activity.actor_id = herald_user.id)
  • Join Filter: ((upper((herald_user.user_id)::text) ~~ '%NEW-COMMENT%'::text) OR (upper((t4.user_id)::text) ~~ '%NEW-COMMENT%'::text) OR (upper((herald_article.title)::text) ~~ '%NEW-COMMENT%'::text) OR (upper((herald_activity.comment_id)::text) ~~ '%NEW-COMMENT%'::text))
  • Rows Removed by Join Filter: 317975
4. 247.944 836.589 ↑ 1.3 317,975 3

Parallel Hash Left Join (cost=8,039.82..25,013.16 rows=397,585 width=111) (actual time=57.973..278.863 rows=317,975 loops=3)

  • Hash Cond: (herald_activity.article_id = herald_article.id)
5. 301.356 518.697 ↑ 1.3 317,975 3

Hash Left Join (cost=3,222.28..19,151.96 rows=397,585 width=82) (actual time=34.351..172.899 rows=317,975 loops=3)

  • Hash Cond: (herald_activity.relation_id = herald_relation.id)
6. 115.017 115.017 ↑ 1.3 317,975 3

Parallel Seq Scan on herald_activity (cost=0.00..14,277.85 rows=397,585 width=72) (actual time=0.009..38.339 rows=317,975 loops=3)

7. 25.458 102.324 ↑ 1.0 39,399 3

Hash (cost=2,729.79..2,729.79 rows=39,399 width=14) (actual time=34.108..34.108 rows=39,399 loops=3)

  • Buckets: 65536 Batches: 1 Memory Usage: 2445kB
8. 30.102 76.866 ↑ 1.0 39,399 3

Hash Left Join (cost=1,981.37..2,729.79 rows=39,399 width=14) (actual time=12.414..25.622 rows=39,399 loops=3)

  • Hash Cond: (herald_relation.followed_id = t4.id)
9. 10.239 10.239 ↑ 1.0 39,399 3

Seq Scan on herald_relation (cost=0.00..644.99 rows=39,399 width=8) (actual time=0.018..3.413 rows=39,399 loops=3)

10. 21.138 36.525 ↑ 1.0 34,194 3

Hash (cost=1,553.94..1,553.94 rows=34,194 width=14) (actual time=12.175..12.175 rows=34,194 loops=3)

  • Buckets: 65536 Batches: 1 Memory Usage: 2059kB
11. 15.387 15.387 ↑ 1.0 34,194 3

Seq Scan on herald_user t4 (cost=0.00..1,553.94 rows=34,194 width=14) (actual time=0.017..5.129 rows=34,194 loops=3)

12. 38.385 69.948 ↑ 1.2 37,602 3

Parallel Hash (cost=4,230.02..4,230.02 rows=47,002 width=45) (actual time=23.316..23.316 rows=37,602 loops=3)

  • Buckets: 131072 Batches: 1 Memory Usage: 10016kB
13. 31.563 31.563 ↑ 1.2 37,602 3

Parallel Seq Scan on herald_article (cost=0.00..4,230.02 rows=47,002 width=45) (actual time=0.015..10.521 rows=37,602 loops=3)

14. 16.863 29.214 ↑ 1.8 11,398 3

Parallel Hash (cost=1,413.14..1,413.14 rows=20,114 width=103) (actual time=9.738..9.738 rows=11,398 loops=3)

  • Buckets: 65536 Batches: 1 Memory Usage: 5632kB
15. 12.351 12.351 ↑ 1.8 11,398 3

Parallel Seq Scan on herald_user (cost=0.00..1,413.14 rows=20,114 width=103) (actual time=0.013..4.117 rows=11,398 loops=3)

Planning time : 2.057 ms
Execution time : 742.895 ms