explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5J43

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 0.944 ↓ 10.0 10 1

Limit (cost=38.49..38.50 rows=1 width=257) (actual time=0.940..0.944 rows=10 loops=1)

2. 0.026 0.940 ↓ 10.0 10 1

Sort (cost=38.49..38.50 rows=1 width=257) (actual time=0.939..0.940 rows=10 loops=1)

  • Sort Key: survey.id DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.060 0.914 ↓ 65.0 65 1

WindowAgg (cost=29.37..38.48 rows=1 width=257) (actual time=0.889..0.914 rows=65 loops=1)

4. 0.038 0.854 ↓ 65.0 65 1

Nested Loop Left Join (cost=29.37..38.47 rows=1 width=241) (actual time=0.482..0.854 rows=65 loops=1)

5. 0.028 0.491 ↓ 65.0 65 1

Hash Join (cost=25.04..27.54 rows=1 width=217) (actual time=0.468..0.491 rows=65 loops=1)

  • Hash Cond: (u.id = survey.created_by)
6. 0.011 0.011 ↓ 1.0 37 1

Seq Scan on "user" u (cost=0.00..2.36 rows=36 width=19) (actual time=0.005..0.011 rows=37 loops=1)

7. 0.020 0.452 ↓ 65.0 65 1

Hash (cost=25.02..25.02 rows=1 width=202) (actual time=0.452..0.452 rows=65 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
8. 0.044 0.432 ↓ 65.0 65 1

Hash Right Join (cost=22.28..25.02 rows=1 width=202) (actual time=0.388..0.432 rows=65 loops=1)

  • Hash Cond: (survey_question.survey_id = survey.id)
9. 0.119 0.182 ↓ 1.1 131 1

HashAggregate (cost=10.98..12.13 rows=115 width=12) (actual time=0.171..0.182 rows=131 loops=1)

  • Group Key: survey_question.survey_id
10. 0.063 0.063 ↓ 1.0 346 1

Seq Scan on survey_question (cost=0.00..9.32 rows=332 width=4) (actual time=0.008..0.063 rows=346 loops=1)

11. 0.027 0.206 ↓ 65.0 65 1

Hash (cost=11.29..11.29 rows=1 width=194) (actual time=0.206..0.206 rows=65 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
12. 0.037 0.179 ↓ 65.0 65 1

Hash Right Join (cost=9.76..11.29 rows=1 width=194) (actual time=0.148..0.179 rows=65 loops=1)

  • Hash Cond: (ss.survey_id = survey.id)
13. 0.016 0.016 ↓ 1.1 35 1

Seq Scan on survey_scheduler ss (cost=0.00..1.40 rows=32 width=51) (actual time=0.007..0.016 rows=35 loops=1)

  • Filter: ((end_date IS NULL) AND (status <> 17))
14. 0.023 0.126 ↓ 65.0 65 1

Hash (cost=9.75..9.75 rows=1 width=147) (actual time=0.126..0.126 rows=65 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
15. 0.103 0.103 ↓ 65.0 65 1

Seq Scan on survey (cost=0.00..9.75 rows=1 width=147) (actual time=0.006..0.103 rows=65 loops=1)

  • Filter: ((end_date IS NULL) AND (status_id <> 55) AND (company_bot_id = 22) AND (parent_id = id))
  • Rows Removed by Filter: 94
16. 0.000 0.325 ↑ 1.0 1 65

Subquery Scan on us (cost=4.33..10.92 rows=1 width=28) (actual time=0.005..0.005 rows=1 loops=65)

  • Filter: (us.survey_id = survey.id)
17. 0.130 0.325 ↑ 6.0 1 65

GroupAggregate (cost=4.33..10.84 rows=6 width=28) (actual time=0.005..0.005 rows=1 loops=65)

  • Group Key: us_1.survey_id
18. 0.130 0.195 ↑ 1.0 6 65

Bitmap Heap Scan on user_survey us_1 (cost=4.33..10.72 rows=6 width=24) (actual time=0.002..0.003 rows=6 loops=65)

  • Recheck Cond: (survey_id = survey.id)
  • Filter: ((end_date IS NULL) AND (draft_ind IS NOT TRUE))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=74
19. 0.065 0.065 ↑ 1.2 6 65

Bitmap Index Scan on user_survey_survey_id_idx (cost=0.00..4.33 rows=7 width=0) (actual time=0.001..0.001 rows=6 loops=65)

  • Index Cond: (survey_id = survey.id)
Planning time : 0.564 ms
Execution time : 1.042 ms