explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ix9v

Settings
# exclusive inclusive rows x rows loops node
1. 1.895 2,825.940 ↓ 12.5 4,920 1

Nested Loop (cost=225,110.33..442,596.86 rows=395 width=521) (actual time=1,376.682..2,825.940 rows=4,920 loops=1)

  • Buffers: shared hit=973659
2.          

CTE a

3. 978.962 1,379.340 ↓ 1.7 4,714 1

HashAggregate (cost=225,082.45..225,109.90 rows=2,745 width=8) (actual time=1,376.642..1,379.340 rows=4,714 loops=1)

  • Group Key: questions_1.global_survey_id
  • Buffers: shared hit=192518
4. 400.378 400.378 ↓ 1.0 2,199,902 1

Seq Scan on questions questions_1 (cost=0.00..214,227.63 rows=2,170,963 width=8) (actual time=0.003..400.378 rows=2,199,902 loops=1)

  • Buffers: shared hit=192518
5. 1,381.561 1,381.561 ↓ 1.7 4,714 1

CTE Scan on a (cost=0.00..54.90 rows=2,745 width=8) (actual time=1,376.645..1,381.561 rows=4,714 loops=1)

  • Buffers: shared hit=192518
6. 1,442.484 1,442.484 ↑ 1.0 1 4,714

Index Scan using index_questions_on_global_survey_id on questions (cost=0.43..79.20 rows=1 width=521) (actual time=0.171..0.306 rows=1 loops=4,714)

  • Index Cond: (global_survey_id = a.global_survey_id)
  • Filter: (a.max = "position")
  • Rows Removed by Filter: 466
  • Buffers: shared hit=781141
Planning time : 0.234 ms
Execution time : 2,826.532 ms