explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4KKQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.027 1,225.126 ↑ 1.0 7 1

Sort (cost=68,011.25..68,011.26 rows=7 width=173) (actual time=1,225.119..1,225.126 rows=7 loops=1)

  • Sort Key: f.forum_order, f.forum_nev
  • Sort Method: quicksort Memory: 26kB
2. 0.033 1,225.099 ↑ 1.0 7 1

Nested Loop (cost=9,708.50..68,011.15 rows=7 width=173) (actual time=178.881..1,225.099 rows=7 loops=1)

3. 0.017 1,213.887 ↑ 1.0 7 1

Nested Loop (cost=9,707.82..67,988.98 rows=7 width=139) (actual time=178.557..1,213.887 rows=7 loops=1)

4. 0.021 0.210 ↑ 1.0 7 1

Nested Loop (cost=9.60..101.28 rows=7 width=131) (actual time=0.094..0.210 rows=7 loops=1)

5. 0.033 0.105 ↑ 1.0 7 1

Hash Right Join (cost=1.16..41.96 rows=7 width=123) (actual time=0.079..0.105 rows=7 loops=1)

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

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

7. 0.006 0.018 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=108) (actual time=0.018..0.018 rows=7 loops=1)

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

Seq Scan on forums f (cost=0.00..1.07 rows=7 width=108) (actual time=0.008..0.012 rows=7 loops=1)

9. 0.028 0.084 ↑ 1.0 1 7

Aggregate (cost=8.45..8.46 rows=1 width=8) (actual time=0.012..0.012 rows=1 loops=7)

10. 0.056 0.056 ↑ 1.1 8 7

Index Only Scan using idx_topics_forum_id on topics topics_1 (cost=0.27..8.42 rows=9 width=0) (actual time=0.005..0.008 rows=8 loops=7)

  • Index Cond: (forum_id = f.forum_id)
  • Heap Fetches: 24
11. 15.015 1,213.660 ↑ 1.0 1 7

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

12. 120.337 1,198.645 ↑ 1.3 17,191 7

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

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

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

14. 0.035 0.161 ↑ 1.2 8 7

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.070 0.126 ↑ 1.2 8 7

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

  • Recheck Cond: ((f.link_topic_id = topic_id) OR (forum_id = f.forum_id))
  • Heap Blocks: exact=35
16. 0.021 0.056 ↓ 0.0 0 7

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

17. 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)
18. 0.028 0.028 ↑ 1.1 8 7

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

  • Index Cond: (forum_id = f.forum_id)
19. 0.014 11.179 ↑ 1.0 1 7

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

20. 9.030 11.165 ↑ 22,462.0 1 7

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

21. 2.135 2.135 ↑ 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.011..0.305 rows=572 loops=7)