explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DJvp

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 1,873.815 ↑ 1.7 6 1

Limit (cost=1.13..9,012.03 rows=10 width=23) (actual time=17.097..1,873.815 rows=6 loops=1)

2. 343.352 1,873.812 ↑ 64.5 6 1

Nested Loop Left Join (cost=1.13..348,723.09 rows=387 width=23) (actual time=17.096..1,873.812 rows=6 loops=1)

  • Join Filter: ((posts_v2.postable_type)::text = 'Blog'::text)
  • Rows Removed by Join Filter: 31753
  • Filter: (((questions.space_id = 16) AND (questions.space_status = ANY ('{0,2}'::integer[])) AND (questions.id <> 0)) OR ((blogs.space_id = 16) AND (blogs.space_status = ANY ('{0,2}'::integer[])) AND blogs.published AND (NOT blogs.deleted) AND (blogs.id <> ALL ('{14433,0}'::bigint[]))))
  • Rows Removed by Filter: 342758
3. 368.653 1,187.696 ↑ 1.0 342,764 1

Nested Loop Left Join (cost=0.84..218,163.02 rows=355,479 width=43) (actual time=0.045..1,187.696 rows=342,764 loops=1)

  • Join Filter: ((posts_v2.postable_type)::text = 'Question'::text)
  • Rows Removed by Join Filter: 166836
4. 133.515 133.515 ↑ 1.0 342,764 1

Index Scan Backward using posts_v2_pkey on posts_v2 (cost=0.42..14,081.47 rows=355,479 width=23) (actual time=0.040..133.515 rows=342,764 loops=1)

5. 685.528 685.528 ↑ 1.0 1 342,764

Index Scan using questions_pkey on questions (cost=0.42..0.56 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=342,764)

  • Index Cond: (id = posts_v2.postable_id)
6. 342.764 342.764 ↓ 0.0 0 342,764

Index Scan using blogs_pkey on blogs (cost=0.29..0.34 rows=1 width=22) (actual time=0.001..0.001 rows=0 loops=342,764)

  • Index Cond: (id = posts_v2.postable_id)