explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gpRD

Settings
# exclusive inclusive rows x rows loops node
1. 0.049 8,768.113 ↓ 2.2 13 1

Sort (cost=191,251.52..191,251.54 rows=6 width=30) (actual time=8,768.112..8,768.113 rows=13 loops=1)

  • Sort Key: chapters.chapter_number
  • Sort Method: quicksort Memory: 26kB
2.          

CTE reads

3. 102.028 8,766.583 ↑ 8.5 14 1

GroupAggregate (cost=190,698.45..191,188.74 rows=119 width=12) (actual time=8,618.365..8,766.583 rows=14 loops=1)

  • Group Key: reading_milestones.chapter_number
4. 140.384 8,664.555 ↓ 3.4 222,194 1

Sort (cost=190,698.45..190,861.49 rows=65,213 width=20) (actual time=8,618.236..8,664.555 rows=222,194 loops=1)

  • Sort Key: reading_milestones.chapter_number
  • Sort Method: quicksort Memory: 23315kB
5. 8,524.171 8,524.171 ↓ 3.4 222,194 1

Index Scan using index_reading_milestones_on_story_id on reading_milestones (cost=0.57..185,483.74 rows=65,213 width=20) (actual time=0.230..8,524.171 rows=222,194 loops=1)

  • Index Cond: (story_id = 259935)
6. 0.049 8,768.064 ↓ 2.2 13 1

Hash Join (cost=4.29..62.70 rows=6 width=30) (actual time=8,767.833..8,768.064 rows=13 loops=1)

  • Hash Cond: (chapters.chapter_number = reads.chapter_number)
7. 1.334 1.334 ↑ 1.6 13 1

Index Scan using index_chapters_on_story_id on chapters (cost=0.43..58.70 rows=21 width=22) (actual time=1.110..1.334 rows=13 loops=1)

  • Index Cond: (story_id = 259935)
  • Filter: (deleted_at IS NULL)
8. 0.039 8,766.681 ↑ 8.5 14 1

Hash (cost=2.38..2.38 rows=119 width=12) (actual time=8,766.681..8,766.681 rows=14 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 8,766.642 8,766.642 ↑ 8.5 14 1

CTE Scan on reads (cost=0.00..2.38 rows=119 width=12) (actual time=8,618.369..8,766.642 rows=14 loops=1)