Skip to content

Commit

Permalink
arrivals_departures/connections: make fast again ⚡️
Browse files Browse the repository at this point in the history
by adding indexes on stop_times.{arrival,departure}_time with `NULLS LAST`, as introduced by b2001e3.

follow-up of b2001e3
  • Loading branch information
derhuerst committed Jul 5, 2024
1 parent 5537810 commit 5b92e5c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/stop_times.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ AND "${opt.schema}".stop_times.stop_sequence = t.stop_sequence;
CREATE INDEX ON "${opt.schema}".stop_times (stop_sequence_consec);
CREATE INDEX ON "${opt.schema}".stop_times (trip_id, stop_sequence_consec);
CREATE INDEX ON "${opt.schema}".stop_times (arrival_time DESC NULLS LAST);
CREATE INDEX ON "${opt.schema}".stop_times (departure_time DESC NULLS LAST);
-- todo: are these two necessary?
CREATE INDEX ON "${opt.schema}".stop_times (arrival_time);
CREATE INDEX ON "${opt.schema}".stop_times (departure_time);
Expand Down

0 comments on commit 5b92e5c

Please sign in to comment.