explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Mxq

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 1,262.135 ↑ 1.0 7 1

Nested Loop (cost=9,714.74..68,054.87 rows=7 width=137) (actual time=162.295..1,262.135 rows=7 loops=1)

2. 0.024 1,247.313 ↑ 1.0 7 1

Nested Loop (cost=9,714.06..68,032.70 rows=7 width=135) (actual time=161.878..1,247.313 rows=7 loops=1)

3. 0.018 0.253 ↑ 1.0 7 1

Nested Loop (cost=15.85..145.00 rows=7 width=127) (actual time=0.112..0.253 rows=7 loops=1)

4. 0.033 0.123 ↑ 1.0 7 1

Hash Right Join (cost=1.16..41.96 rows=7 width=119) (actual time=0.096..0.123 rows=7 loops=1)

  • Hash Cond: (lt.topic_id = f.link_topic_id)
5. 0.069 0.069 ↑ 1.0 53 1

Seq Scan on topics lt (cost=0.00..40.53 rows=53 width=19) (actual time=0.007..0.069 rows=53 loops=1)

6. 0.007 0.021 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=104) (actual time=0.020..0.021 rows=7 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
7. 0.014 0.014 ↑ 1.0 7 1

Seq Scan on forums f (cost=0.00..1.07 rows=7 width=104) (actual time=0.010..0.014 rows=7 loops=1)

8. 0.112 0.112 ↑ 1.0 1 7

Aggregate (cost=14.69..14.70 rows=1 width=8) (actual time=0.015..0.016 rows=1 loops=7)

  • -> Index Only Scan using idx_topics_forum_id on topics topics_1 (cost=0.27..14.67 rows=9 width=0) (actual time=0.006..0.012 rows=8 loops=7
  • Index Cond: (forum_id = f.forum_id)
  • Heap Fetches: 55
9. 15.484 1,247.036 ↑ 1.0 1 7

Aggregate (cost=9,698.21..9,698.22 rows=1 width=8) (actual time=178.148..178.148 rows=1 loops=7)

10. 124.173 1,231.552 ↑ 1.3 17,191 7

Hash Join (cost=32.08..9,642.06 rows=22,462 width=647) (actual time=0.189..175.936 rows=17,191 loops=7)

  • Hash Cond: (p.topic_id = t.topic_id)
11. 1,107.183 1,107.183 ↑ 1.0 119,049 7

Seq Scan on posts p (cost=0.00..9,272.49 rows=119,049 width=651) (actual time=0.023..158.169 rows=119,049 loops=7)

12. 0.042 0.196 ↑ 1.2 8 7

Hash (cost=31.95..31.95 rows=10 width=4) (actual time=0.028..0.028 rows=8 loops=7)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.091 0.154 ↑ 1.2 8 7

Bitmap Heap Scan on topics t (cost=8.61..31.95 rows=10 width=4) (actual time=0.015..0.022 rows=8 loops=7)

  • Recheck Cond: ((f.link_topic_id = topic_id) OR (forum_id = f.forum_id))
  • Heap Blocks: exact=36
14. 0.014 0.063 ↓ 0.0 0 7

BitmapOr (cost=8.61..8.61 rows=10 width=0) (actual time=0.009..0.009 rows=0 loops=7)

15. 0.007 0.007 ↓ 0.0 0 7

Bitmap Index Scan on pkey_topics (cost=0.00..4.27 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=7)

  • Index Cond: (topic_id = f.link_topic_id)
16. 0.042 0.042 ↓ 1.1 10 7

Bitmap Index Scan on idx_topics_forum_id (cost=0.00..4.33 rows=9 width=0) (actual time=0.006..0.006 rows=10 loops=7)

  • Index Cond: (forum_id = f.forum_id)
17. 0.014 14.791 ↑ 1.0 1 7

Limit (cost=0.68..3.15 rows=1 width=21) (actual time=2.113..2.113 rows=1 loops=7)

18. 0.454 14.777 ↑ 22,462.0 1 7

Nested Loop (cost=0.68..55,340.61 rows=22,462 width=21) (actual time=2.111..2.111 rows=1 loops=7)

19. 2.317 2.317 ↑ 208.1 572 7

Index Scan Backward using pkey_posts on posts p_1 (cost=0.42..20,974.06 rows=119,049 width=25) (actual time=0.012..0.331 rows=572 loops=7)

20. 12.006 12.006 ↓ 0.0 0 4,002

Index Scan using pkey_topics on topics t_1 (cost=0.27..0.29 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=4,002)

  • Index Cond: (topic_id = p_1.topic_id)