explain.depesz.com

PostgreSQL's explain analyze made readable

Result: C5TF

Settings
# exclusive inclusive rows x rows loops node
1. 24.060 1,405.843 ↓ 60.2 1,506 1

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

  • Group Key: ""user"".id
2. 309.430 1,381.783 ↓ 2,613.0 65,325 1

Nested Loop (cost=233.02..433.09 rows=25 width=5) (actual time=1.945..1,381.783 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,395,578
3. 13.098 28.261 ↓ 717.1 74,578 1

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

4. 2.262 6.031 ↓ 5.1 1,522 1

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

  • Merge Cond: (""user"".id = license.user_id)
5. 1.225 1.225 ↓ 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.011..1.225 rows=2,774 loops=1)

  • Heap Fetches: 89
6. 1.048 2.544 ↓ 5.1 1,523 1

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

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

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

  • Filter: (completed AND passed AND (lesson_program_id = 1))
  • Rows Removed by Filter: 5,685
8. 9.084 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.024 0.048 ↓ 49.0 49 1

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

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

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

11. 0.002 0.012 ↓ 5.0 5 1

Hash (cost=6.24..6.24 rows=1 width=8) (actual time=0.012..0.012 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. 1,044.092 1,044.092 ↑ 1.8 33 74,578

Index Scan using user_quiz_answer_user_id_quiz_question_id on user_quiz_answer (cost=0.08..1.19 rows=59 width=9) (actual time=0.004..0.014 rows=33 loops=74,578)

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