explain.depesz.com

PostgreSQL's explain analyze made readable

Result: iyyb

Settings
# exclusive inclusive rows x rows loops node
1. 23.444 1,180.382 ↓ 60.2 1,506 1

GroupAggregate (cost=233.02..433.20 rows=25 width=12) (actual time=2.444..1,180.382 rows=1,506 loops=1)

  • Group Key: ""user"".id
2. 309.262 1,156.938 ↓ 2,613.0 65,325 1

Nested Loop (cost=233.02..433.09 rows=25 width=5) (actual time=1.664..1,156.938 rows=65,325 loops=1)

  • Join Filter: (quiz_concept_question.quiz_question_id = user_quiz_answer.quiz_question_id)
  • Rows Removed by Join Filter: 2,525,881
3. 12.545 27.318 ↓ 717.1 74,578 1

Nested Loop (cost=232.94..288.20 rows=104 width=12) (actual time=1.649..27.318 rows=74,578 loops=1)

4. 2.221 5.641 ↓ 5.1 1,522 1

Merge Join (cost=226.69..279.74 rows=297 width=12) (actual time=1.617..5.641 rows=1,522 loops=1)

  • Merge Cond: (""user"".id = license.user_id)
5. 1.175 1.175 ↓ 1.0 2,774 1

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

  • Heap Fetches: 89
6. 0.988 2.245 ↓ 5.1 1,523 1

Sort (cost=226.64..226.78 rows=297 width=8) (actual time=1.597..2.245 rows=1,523 loops=1)

  • Sort Key: license.user_id
  • Sort Method: quicksort Memory: 120kB
7. 1.257 1.257 ↓ 5.1 1,528 1

Seq Scan on license (cost=0.00..224.20 rows=297 width=8) (actual time=0.012..1.257 rows=1,528 loops=1)

  • Filter: (completed AND passed AND (lesson_program_id = 1))
  • Rows Removed by Filter: 5,685
8. 9.066 9.132 ↓ 49.0 49 1,522

Materialize (cost=6.25..7.42 rows=1 width=8) (actual time=0.000..0.006 rows=49 loops=1,522)

9. 0.037 0.066 ↓ 49.0 49 1

Hash Join (cost=6.25..7.42 rows=1 width=8) (actual time=0.028..0.066 rows=49 loops=1)

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

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

11. 0.003 0.013 ↓ 5.0 5 1

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

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

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

  • Index Cond: (lesson_program_id = 1)
13. 820.358 820.358 ↑ 1.7 35 74,578

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.004..0.011 rows=35 loops=74,578)

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