explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SZFD

Settings
# exclusive inclusive rows x rows loops node
1. 39.656 1,369.640 ↓ 2.9 2,781 1

GroupAggregate (cost=6.38..1,424.00 rows=970 width=12) (actual time=0.592..1,369.640 rows=2,781 loops=1)

  • Group Key: ""user"".id
2. 342.431 1,329.984 ↓ 140.5 136,269 1

Nested Loop Left Join (cost=6.38..1,419.63 rows=970 width=5) (actual time=0.057..1,329.984 rows=136,269 loops=1)

  • Join Filter: (user_quiz_answer.quiz_question_id = quiz_concept_question.quiz_question_id)
  • Rows Removed by Join Filter: 2,815,753
3. 21.272 33.670 ↓ 140.5 136,269 1

Nested Loop (cost=6.30..68.26 rows=970 width=8) (actual time=0.045..33.670 rows=136,269 loops=1)

4. 1.274 1.274 ↓ 1.0 2,781 1

Index Only Scan using user_pkey on ""user"" (cost=0.06..51.14 rows=2,772 width=4) (actual time=0.012..1.274 rows=2,781 loops=1)

  • Heap Fetches: 96
5. 11.074 11.124 ↓ 49.0 49 2,781

Materialize (cost=6.25..7.42 rows=1 width=4) (actual time=0.000..0.004 rows=49 loops=2,781)

6. 0.023 0.050 ↓ 49.0 49 1

Hash Join (cost=6.25..7.42 rows=1 width=4) (actual time=0.030..0.050 rows=49 loops=1)

  • Hash Cond: (quiz_concept_question.quiz_concept_id = quiz_concept.id)
7. 0.014 0.014 ↑ 1.0 49 1

Seq Scan on quiz_concept_question (cost=0.00..1.15 rows=49 width=8) (actual time=0.009..0.014 rows=49 loops=1)

8. 0.004 0.013 ↓ 5.0 5 1

Hash (cost=6.24..6.24 rows=1 width=4) (actual time=0.013..0.013 rows=5 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.009 0.009 ↓ 5.0 5 1

Index Scan using quiz_concept_name_lesson_program_id on quiz_concept (cost=0.03..6.24 rows=1 width=4) (actual time=0.008..0.009 rows=5 loops=1)

  • Index Cond: (lesson_program_id = 1)
10. 953.883 953.883 ↑ 2.8 21 136,269

Index Scan using user_quiz_answer_user_id_index on user_quiz_answer (cost=0.08..1.19 rows=59 width=9) (actual time=0.003..0.007 rows=21 loops=136,269)

  • Index Cond: (user_id = ""user"".id)
Planning time : 0.490 ms
Execution time : 1,370.095 ms