explain.depesz.com

PostgreSQL's explain analyze made readable

Result: O1eU

Settings
# exclusive inclusive rows x rows loops node
1. 25.056 65.110 ↓ 1.0 13,542 1

Sort (cost=17,376.98..17,410.83 rows=13,539 width=2,633) (actual time=61.759..65.110 rows=13,542 loops=1)

  • Sort Key: cohorts_achievers.created_on DESC
  • Sort Method: external merge Disk: 6408kB
  • Planning time: 4.921 ms
  • Execution time: 66.816 ms
2. 6.720 40.054 ↓ 1.0 13,542 1

Hash Left Join (cost=327.95..1,037.38 rows=13,539 width=2,633) (actual time=3.659..40.054 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.question_id)::text = (questions.id)::text)
3. 5.477 32.023 ↓ 1.0 13,542 1

Hash Left Join (cost=155.75..829.52 rows=13,539 width=2,593) (actual time=2.339..32.023 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.topic_id)::text = (topics.id)::text)
4. 5.241 26.489 ↓ 1.0 13,542 1

Hash Left Join (cost=147.72..782.67 rows=13,539 width=1,859) (actual time=2.276..26.489 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.module_id)::text = (modules.id)::text)
5. 5.282 21.223 ↓ 1.0 13,542 1

Hash Left Join (cost=145.38..734.75 rows=13,539 width=1,125) (actual time=2.243..21.223 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.user_id)::text = (users.id)::text)
6. 5.591 13.826 ↓ 1.0 13,542 1

Hash Left Join (cost=9.42..563.17 rows=13,539 width=1,107) (actual time=0.121..13.826 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.cohort_id)::text = (cohorts.id)::text)
7. 3.468 8.188 ↓ 1.0 13,542 1

Hash Left Join (cost=5.52..519.97 rows=13,539 width=373) (actual time=0.066..8.188 rows=13,542 loops=1)

  • Hash Cond: ((cohorts_achievers.assignment_id)::text = (assignment.id)::text)
8. 4.682 4.682 ↓ 1.0 13,542 1

Seq Scan on cohorts_achievers (cost=0.00..478.91 rows=13,539 width=155) (actual time=0.018..4.682 rows=13,542 loops=1)

  • Filter: (has_finished AND ((question_id IS NOT NULL) OR (assignment_id IS NOT NULL)))
  • Rows Removed by Filter: 849
9. 0.015 0.038 ↑ 1.0 23 1

Hash (cost=5.23..5.23 rows=23 width=250) (actual time=0.038..0.038 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
10. 0.023 0.023 ↑ 1.0 23 1

Seq Scan on assignment (cost=0.00..5.23 rows=23 width=250) (actual time=0.005..0.023 rows=23 loops=1)

11. 0.021 0.047 ↑ 1.0 40 1

Hash (cost=3.40..3.40 rows=40 width=766) (actual time=0.047..0.047 rows=40 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
12. 0.026 0.026 ↑ 1.0 40 1

Seq Scan on cohorts (cost=0.00..3.40 rows=40 width=766) (actual time=0.005..0.026 rows=40 loops=1)

13. 0.858 2.115 ↑ 1.0 1,865 1

Hash (cost=112.65..112.65 rows=1,865 width=60) (actual time=2.115..2.115 rows=1,865 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 186kB
14. 1.257 1.257 ↑ 1.0 1,865 1

Seq Scan on users (cost=0.00..112.65 rows=1,865 width=60) (actual time=0.006..1.257 rows=1,865 loops=1)

15. 0.010 0.025 ↑ 1.0 15 1

Hash (cost=2.15..2.15 rows=15 width=766) (actual time=0.025..0.025 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
16. 0.015 0.015 ↑ 1.0 15 1

Seq Scan on modules (cost=0.00..2.15 rows=15 width=766) (actual time=0.008..0.015 rows=15 loops=1)

17. 0.024 0.057 ↑ 1.0 46 1

Hash (cost=7.46..7.46 rows=46 width=766) (actual time=0.057..0.057 rows=46 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
18. 0.033 0.033 ↑ 1.0 46 1

Seq Scan on topics (cost=0.00..7.46 rows=46 width=766) (actual time=0.005..0.033 rows=46 loops=1)

19. 0.530 1.311 ↑ 1.0 1,120 1

Hash (cost=158.20..158.20 rows=1,120 width=61) (actual time=1.311..1.311 rows=1,120 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 113kB
20. 0.781 0.781 ↑ 1.0 1,120 1

Seq Scan on questions (cost=0.00..158.20 rows=1,120 width=61) (actual time=0.005..0.781 rows=1,120 loops=1)