explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G5Xb

Settings
# exclusive inclusive rows x rows loops node
1. 6,479.110 6,479.110 ↑ 2.3 4,714 1

CTE Scan on a (cost=503,949.80..552,796.47 rows=10,855 width=12) (actual time=3,923.691..6,479.110 rows=4,714 loops=1)

  • Filter: (num = 1)
  • Rows Removed by Filter: 2195188
  • Buffers: shared hit=192518, temp read=4840 written=11822
2.          

CTE a

3. 921.150 5,642.999 ↓ 1.0 2,199,902 1

WindowAgg (cost=460,530.54..503,949.80 rows=2,170,963 width=8) (actual time=3,923.681..5,642.999 rows=2,199,902 loops=1)

  • Buffers: shared hit=192518, temp read=4840 written=4840
4. 3,806.166 4,721.849 ↓ 1.0 2,199,902 1

Sort (cost=460,530.54..465,957.95 rows=2,170,963 width=8) (actual time=3,923.674..4,721.849 rows=2,199,902 loops=1)

  • Sort Key: questions.global_survey_id, questions."position" DESC
  • Sort Method: external merge Disk: 38712kB
  • Buffers: shared hit=192518, temp read=4840 written=4840
5. 915.683 915.683 ↓ 1.0 2,199,902 1

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

  • Buffers: shared hit=192518
Planning time : 0.054 ms
Execution time : 6,520.535 ms