Skip to content

Commit 5b92e5c

Browse files
committed
arrivals_departures/connections: make fast again ⚡️
by adding indexes on stop_times.{arrival,departure}_time with `NULLS LAST`, as introduced by b2001e3. follow-up of b2001e3
1 parent 5537810 commit 5b92e5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/stop_times.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ AND "${opt.schema}".stop_times.stop_sequence = t.stop_sequence;
108108
109109
CREATE INDEX ON "${opt.schema}".stop_times (stop_sequence_consec);
110110
CREATE INDEX ON "${opt.schema}".stop_times (trip_id, stop_sequence_consec);
111+
CREATE INDEX ON "${opt.schema}".stop_times (arrival_time DESC NULLS LAST);
112+
CREATE INDEX ON "${opt.schema}".stop_times (departure_time DESC NULLS LAST);
113+
-- todo: are these two necessary?
111114
CREATE INDEX ON "${opt.schema}".stop_times (arrival_time);
112115
CREATE INDEX ON "${opt.schema}".stop_times (departure_time);
113116

0 commit comments

Comments
 (0)