explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FQX

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 200.236 ↑ 1.0 10 1

Limit (cost=1.84..41,722.57 rows=10 width=23) (actual time=11.263..200.236 rows=10 loops=1)

2. 24.036 200.233 ↑ 32.1 10 1

Nested Loop Left Join (cost=1.84..1,339,237.24 rows=321 width=23) (actual time=11.262..200.233 rows=10 loops=1)

  • Filter: (((question_topics.topic_id = 2694) AND (questions.status = 2) AND (questions.good_answers_count > 0)) OR ((blog_topics.topic_id = 2694) AND (blogs.status = 2) AND blogs.published AND (NOT blogs.deleted)))
  • Rows Removed by Filter: 68045
3. 17.110 139.946 ↑ 24.6 36,251 1

Nested Loop Left Join (cost=1.42..621,557.44 rows=890,171 width=53) (actual time=0.027..139.946 rows=36,251 loops=1)

4. 7.896 122.836 ↑ 11.6 30,753 1

Nested Loop Left Join (cost=1.13..343,394.90 rows=355,479 width=53) (actual time=0.026..122.836 rows=30,753 loops=1)

  • Join Filter: ((posts_v2.postable_type)::text = 'Blog'::text)
  • Rows Removed by Join Filter: 25
5. 8.886 84.187 ↑ 11.6 30,753 1

Nested Loop Left Join (cost=0.84..218,167.02 rows=355,479 width=39) (actual time=0.025..84.187 rows=30,753 loops=1)

  • Join Filter: ((posts_v2.postable_type)::text = 'Question'::text)
  • Rows Removed by Join Filter: 2967
6. 13.795 13.795 ↑ 11.6 30,753 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.022..13.795 rows=30,753 loops=1)

7. 61.506 61.506 ↑ 1.0 1 30,753

Index Scan using questions_pkey on questions (cost=0.42..0.56 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=30,753)

  • Index Cond: (id = posts_v2.postable_id)
8. 30.753 30.753 ↓ 0.0 0 30,753

Index Scan using blogs_pkey on blogs (cost=0.29..0.34 rows=1 width=14) (actual time=0.001..0.001 rows=0 loops=30,753)

  • Index Cond: (id = posts_v2.postable_id)
9. 0.000 0.000 ↓ 0.0 0 30,753

Index Scan using index_blog_topics_on_blog_id on blog_topics (cost=0.29..0.75 rows=3 width=16) (actual time=0.000..0.000 rows=0 loops=30,753)

  • Index Cond: (blog_id = blogs.id)
10. 36.251 36.251 ↑ 4.0 1 36,251

Index Scan using index_question_topics_on_question_id on question_topics (cost=0.42..0.72 rows=4 width=16) (actual time=0.001..0.001 rows=1 loops=36,251)

  • Index Cond: (question_id = questions.id)