explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Phas

Settings
# exclusive inclusive rows x rows loops node
1. 66.230 198.558 ↓ 171.6 27,456 1

Merge Join (cost=488.32..9,066.55 rows=160 width=143) (actual time=3.917..198.558 rows=27,456 loops=1)

  • Merge Cond: (rs.schedule_id = schd.schedule_id)
  • Join Filter: (((row_number() OVER (?) + 1)) = rs.idx)
  • Rows Removed by Join Filter: 340623
2. 3.573 39.571 ↑ 1.0 32,045 1

Subquery Scan on rs (cost=0.29..3,795.31 rows=32,045 width=75) (actual time=0.025..39.571 rows=32,045 loops=1)

  • Filter: (rs.schedule_stop_id IS NOT NULL)
3. 22.929 35.998 ↑ 1.0 32,045 1

WindowAgg (cost=0.29..3,474.86 rows=32,045 width=75) (actual time=0.024..35.998 rows=32,045 loops=1)

4. 13.069 13.069 ↑ 1.0 32,045 1

Index Scan using schedule_stop_idx1 on schedule_stop schds (cost=0.29..2,914.07 rows=32,045 width=67) (actual time=0.012..13.069 rows=32,045 loops=1)

5. 36.736 92.757 ↓ 11.5 368,074 1

Materialize (cost=487.61..4,991.39 rows=32,045 width=92) (actual time=3.859..92.757 rows=368,074 loops=1)

6. 25.071 56.021 ↑ 1.0 32,045 1

WindowAgg (cost=487.61..4,590.83 rows=32,045 width=136) (actual time=3.851..56.021 rows=32,045 loops=1)

7. 9.812 30.950 ↑ 1.0 32,045 1

Merge Join (cost=487.61..3,949.93 rows=32,045 width=96) (actual time=3.835..30.950 rows=32,045 loops=1)

  • Merge Cond: (schds_1.schedule_id = schd.schedule_id)
8. 15.057 15.057 ↑ 1.0 32,045 1

Index Scan using schedule_stop_idx1 on schedule_stop schds_1 (cost=0.29..2,914.07 rows=32,045 width=60) (actual time=0.007..15.057 rows=32,045 loops=1)

9. 3.523 6.081 ↓ 7.0 32,040 1

Sort (cost=487.32..498.80 rows=4,589 width=36) (actual time=3.823..6.081 rows=32,040 loops=1)

  • Sort Key: schd.schedule_id
  • Sort Method: quicksort Memory: 551kB
10. 1.612 2.558 ↑ 1.0 4,589 1

Hash Join (cost=38.23..208.22 rows=4,589 width=36) (actual time=0.341..2.558 rows=4,589 loops=1)

  • Hash Cond: (schd.carrier_id = car.carrier_id)
11. 0.642 0.642 ↑ 1.0 4,589 1

Seq Scan on schedule schd (cost=0.00..157.89 rows=4,589 width=32) (actual time=0.008..0.642 rows=4,589 loops=1)

12. 0.129 0.304 ↑ 1.0 988 1

Hash (cost=25.88..25.88 rows=988 width=12) (actual time=0.304..0.304 rows=988 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 51kB
13. 0.175 0.175 ↑ 1.0 988 1

Seq Scan on carrier car (cost=0.00..25.88 rows=988 width=12) (actual time=0.006..0.175 rows=988 loops=1)

Planning time : 1.172 ms
Execution time : 199.780 ms