explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s37b

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 38,791.933 ↑ 1.0 1 1

Limit (cost=259,548.83..259,548.97 rows=1 width=4) (actual time=38,791.929..38,791.933 rows=1 loops=1)

2. 50.702 38,791.929 ↑ 2,084.0 1 1

Seq Scan on pybb_topic (cost=259,548.83..259,833.13 rows=2,084 width=4) (actual time=38,791.928..38,791.929 rows=1 loops=1)

  • Filter: ((NOT (hashed SubPlan 1)) AND (forum_id = 1))
  • Rows Removed by Filter: 1
3.          

SubPlan (for Seq Scan)

4. 29,424.043 38,741.227 ↓ 6.0 156,418 1

Nested Loop (cost=324.04..259,484.19 rows=25,857 width=4) (actual time=69.559..38,741.227 rows=156,418 loops=1)

  • Join Filter: (((u2.time_stamp >= u0.updated) AND (u2.user_id = 392345)) OR ((u4.time_stamp >= u0.updated) AND (u4.user_id = 392345)))
  • Rows Removed by Join Filter: 78609895
5. 676.708 920.775 ↓ 1.2 399,829 1

Hash Right Join (cost=318.34..17,520.91 rows=346,870 width=28) (actual time=8.979..920.775 rows=399,829 loops=1)

  • Hash Cond: (u2.topic_id = u0.id)
6. 235.137 235.137 ↓ 1.1 683,032 1

Seq Scan on pybb_topicreadtracker u2 (cost=0.00..11,480.09 rows=601,009 width=16) (actual time=0.008..235.137 rows=683,032 loops=1)

7. 1.133 8.930 ↑ 1.0 4,167 1

Hash (cost=266.25..266.25 rows=4,167 width=16) (actual time=8.930..8.930 rows=4,167 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 260kB
8. 7.797 7.797 ↑ 1.0 4,167 1

Seq Scan on pybb_topic u0 (cost=0.00..266.25 rows=4,167 width=16) (actual time=0.007..7.797 rows=4,167 loops=1)

  • Filter: (forum_id = 1)
  • Rows Removed by Filter: 3054
9. 8,396.214 8,396.409 ↓ 6.4 197 399,829

Materialize (cost=5.70..21.53 rows=31 width=16) (actual time=0.000..0.021 rows=197 loops=399,829)

10. 0.054 0.195 ↓ 6.4 197 1

Nested Loop Left Join (cost=5.70..21.38 rows=31 width=16) (actual time=0.081..0.195 rows=197 loops=1)

  • Join Filter: (u1.id = u4.forum_id)
11. 0.010 0.010 ↑ 1.0 1 1

Seq Scan on pybb_forum u1 (cost=0.00..1.07 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=1)

  • Filter: (id = 1)
  • Rows Removed by Filter: 5
12. 0.077 0.131 ↓ 1.1 197 1

Bitmap Heap Scan on pybb_forumreadtracker u4 (cost=5.70..18.00 rows=184 width=16) (actual time=0.065..0.131 rows=197 loops=1)

  • Recheck Cond: (forum_id = 1)
  • Heap Blocks: exact=10
13. 0.054 0.054 ↓ 1.1 197 1

Bitmap Index Scan on pybb_forumreadtracker_forum_id (cost=0.00..5.66 rows=184 width=0) (actual time=0.053..0.054 rows=197 loops=1)

  • Index Cond: (forum_id = 1)