explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ufzI

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 92.642 ↑ 1.0 6 1

Limit (cost=33,103.27..33,103.97 rows=6 width=1,694) (actual time=92.639..92.642 rows=6 loops=1)

2. 12.916 99.445 ↑ 98.7 6 1

Gather Merge (cost=33,103.27..33,172.34 rows=592 width=1,694) (actual time=92.638..99.445 rows=6 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 2.257 86.529 ↑ 59.2 5 3 / 3

Sort (cost=32,103.24..32,103.98 rows=296 width=1,694) (actual time=86.528..86.529 rows=5 loops=3)

  • Sort Key: topic_links.clicks DESC, topic_links.created_at DESC
  • Sort Method: top-N heapsort Memory: 40kB
  • Worker 0: Sort Method: top-N heapsort Memory: 48kB
  • Worker 1: Sort Method: top-N heapsort Memory: 52kB
4. 1.136 84.272 ↓ 3.5 1,025 3 / 3

Nested Loop (cost=16,645.21..32,097.94 rows=296 width=1,694) (actual time=70.926..84.272 rows=1,025 loops=3)

5. 11.130 78.013 ↓ 3.0 1,025 3 / 3

Parallel Hash Join (cost=16,644.78..29,984.68 rows=338 width=759) (actual time=70.893..78.013 rows=1,025 loops=3)

  • Hash Cond: (topic_links.topic_id = topics.id)
6. 12.655 14.016 ↑ 1.0 1,840 3 / 3

Parallel Bitmap Heap Scan on topic_links (cost=195.80..12,564.73 rows=1,890 width=172) (actual time=4.960..14.016 rows=1,840 loops=3)

  • Recheck Cond: (user_id = 1)
  • Filter: ((NOT internal) AND (NOT reflection) AND (NOT quote))
  • Rows Removed by Filter: 1,454
  • Heap Blocks: exact=1,690
7. 1.361 1.361 ↓ 1.0 10,325 1 / 3

Bitmap Index Scan on index_topic_links_on_user_id (cost=0.00..194.67 rows=9,899 width=0) (actual time=4.082..4.082 rows=10,325 loops=1)

  • Index Cond: (user_id = 1)
8. 16.823 52.867 ↑ 1.2 9,466 3 / 3

Parallel Hash (cost=15,432.16..15,432.16 rows=11,586 width=587) (actual time=52.867..52.867 rows=9,466 loops=3)

  • Buckets: 8,192 Batches: 8 Memory Usage: 2,080kB
9. 36.006 36.044 ↑ 1.2 9,466 3 / 3

Parallel Seq Scan on topics (cost=6.64..15,432.16 rows=11,586 width=587) (actual time=0.075..36.044 rows=9,466 loops=3)

  • Filter: ((deleted_at IS NULL) AND (deleted_at IS NULL) AND visible AND ((archetype)::text <> 'private_message'::text) AND ((category_id IS NULL) OR (hashed SubPlan 1)))
  • Rows Removed by Filter: 42,303
10.          

SubPlan (for Parallel Seq Scan)

11. 0.038 0.038 ↑ 1.0 40 3 / 3

Seq Scan on categories (cost=0.00..6.54 rows=40 width=4) (actual time=0.012..0.038 rows=40 loops=3)

  • Filter: (NOT read_restricted)
  • Rows Removed by Filter: 14
12. 5.123 5.123 ↑ 1.0 1 3,074 / 3

Index Scan using index_posts_on_id_and_baked_version on posts (cost=0.42..6.25 rows=1 width=931) (actual time=0.005..0.005 rows=1 loops=3,074)

  • Index Cond: (id = topic_links.post_id)
  • Filter: (post_type = ANY ('{1,2,3}'::integer[]))
Planning time : 1.360 ms
Execution time : 99.599 ms