explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jI1R

Settings
# exclusive inclusive rows x rows loops node
1. 0.293 36,807.226 ↓ 8.0 8 1

Merge Join (cost=4,034,068.41..4,539,264.42 rows=1 width=168) (actual time=36,807.202..36,807.226 rows=8 loops=1)

  • Merge Cond: (dschds.dispatch_schedule_id = ls.dispatch_schedule_id)
  • Join Filter: ((ls.schedule_id = schds.schedule_id) AND (ls.idx = (row_number() OVER (?))))
  • Rows Removed by Join Filter: 73
  • Functions: 61
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 7.754 ms, Inlining 93.117 ms, Optimization 560.614 ms, Emission 386.687 ms, Total 1048.172 ms
2. 1.911 12,239.724 ↑ 1,732.5 4,022 1

WindowAgg (cost=1,675,281.79..1,814,646.07 rows=6,968,214 width=99) (actual time=12,237.111..12,239.724 rows=4,022 loops=1)

3. 8,609.578 12,237.813 ↑ 1,732.1 4,023 1

Sort (cost=1,675,281.79..1,692,702.32 rows=6,968,214 width=91) (actual time=12,237.035..12,237.813 rows=4,023 loops=1)

  • Sort Key: dschds.dispatch_schedule_id, dschds.depart_date_time
  • Sort Method: external merge Disk: 737184kB
4. 1,726.991 3,628.235 ↑ 1.0 6,968,214 1

Hash Join (cost=1,556.01..168,744.13 rows=6,968,214 width=91) (actual time=1,058.558..3,628.235 rows=6,968,214 loops=1)

  • Hash Cond: (dschds.schedule_stop_id = schds.schedule_stop_id)
5. 842.771 842.771 ↑ 1.0 6,968,214 1

Seq Scan on dispatch_schedule_stop dschds (cost=0.00..148,894.14 rows=6,968,214 width=32) (actual time=0.019..842.771 rows=6,968,214 loops=1)

6. 8.550 1,058.473 ↑ 1.0 32,045 1

Hash (cost=1,155.45..1,155.45 rows=32,045 width=67) (actual time=1,058.473..1,058.473 rows=32,045 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 3577kB
7. 1,049.923 1,049.923 ↑ 1.0 32,045 1

Seq Scan on schedule_stop schds (cost=0.00..1,155.45 rows=32,045 width=67) (actual time=1,041.965..1,049.923 rows=32,045 loops=1)

8. 0.018 24,567.209 ↓ 73.0 73 1

Materialize (cost=2,358,786.62..2,637,515.18 rows=1 width=117) (actual time=19,556.775..24,567.209 rows=73 loops=1)

9. 488.248 24,567.191 ↓ 9.0 9 1

Subquery Scan on ls (cost=2,358,786.62..2,637,515.18 rows=1 width=117) (actual time=19,556.770..24,567.191 rows=9 loops=1)

  • Filter: (((ls.carrier_code)::text = 'BSB'::text) AND ((ls.schedule_number)::text = '0001'::text) AND (ls.schedule_date = '2020-03-16'::date))
  • Rows Removed by Filter: 6968205
10. 3,158.118 24,078.943 ↑ 1.0 6,968,214 1

WindowAgg (cost=2,358,786.62..2,515,571.44 rows=6,968,214 width=149) (actual time=19,553.695..24,078.943 rows=6,968,214 loops=1)

11. 12,382.931 20,920.825 ↑ 1.0 6,968,214 1

Sort (cost=2,358,786.62..2,376,207.16 rows=6,968,214 width=109) (actual time=19,553.655..20,920.825 rows=6,968,214 loops=1)

  • Sort Key: dschds_1.dispatch_schedule_id, dschds_1.depart_date_time
  • Sort Method: external merge Disk: 893736kB
12. 1,237.289 8,537.894 ↑ 1.0 6,968,214 1

Hash Join (cost=42,576.11..352,084.96 rows=6,968,214 width=109) (actual time=402.927..8,537.894 rows=6,968,214 loops=1)

  • Hash Cond: (schd.carrier_id = car.carrier_id)
13. 1,284.411 7,300.293 ↑ 1.0 6,968,214 1

Hash Join (cost=42,537.88..333,676.71 rows=6,968,214 width=105) (actual time=402.600..7,300.293 rows=6,968,214 loops=1)

  • Hash Cond: (schds_1.schedule_id = schd.schedule_id)
14. 1,580.518 6,014.137 ↑ 1.0 6,968,214 1

Hash Join (cost=42,322.63..315,153.38 rows=6,968,214 width=81) (actual time=400.829..6,014.137 rows=6,968,214 loops=1)

  • Hash Cond: (dschds_1.schedule_stop_id = schds_1.schedule_stop_id)
15. 3,001.119 4,417.400 ↑ 1.0 6,968,214 1

Hash Join (cost=40,766.62..295,303.39 rows=6,968,214 width=33) (actual time=384.567..4,417.400 rows=6,968,214 loops=1)

  • Hash Cond: (dschds_1.dispatch_schedule_id = dschd.dispatch_schedule_id)
16. 1,032.207 1,032.207 ↑ 1.0 6,968,214 1

Seq Scan on dispatch_schedule_stop dschds_1 (cost=0.00..148,894.14 rows=6,968,214 width=24) (actual time=0.028..1,032.207 rows=6,968,214 loops=1)

17. 194.546 384.074 ↑ 1.0 971,094 1

Hash (cost=22,936.94..22,936.94 rows=971,094 width=17) (actual time=384.074..384.074 rows=971,094 loops=1)

  • Buckets: 65536 Batches: 16 Memory Usage: 3852kB
18. 189.528 189.528 ↑ 1.0 971,094 1

Seq Scan on dispatch_schedule dschd (cost=0.00..22,936.94 rows=971,094 width=17) (actual time=0.024..189.528 rows=971,094 loops=1)

19. 7.707 16.219 ↑ 1.0 32,045 1

Hash (cost=1,155.45..1,155.45 rows=32,045 width=56) (actual time=16.219..16.219 rows=32,045 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 3138kB
20. 8.512 8.512 ↑ 1.0 32,045 1

Seq Scan on schedule_stop schds_1 (cost=0.00..1,155.45 rows=32,045 width=56) (actual time=0.012..8.512 rows=32,045 loops=1)

21. 0.758 1.745 ↑ 1.0 4,589 1

Hash (cost=157.89..157.89 rows=4,589 width=32) (actual time=1.745..1.745 rows=4,589 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 350kB
22. 0.987 0.987 ↑ 1.0 4,589 1

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

23. 0.135 0.312 ↑ 1.0 988 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 51kB
24. 0.177 0.177 ↑ 1.0 988 1

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

Execution time : 37,016.593 ms