The SELECT
executes extremely fast because there is no gtfs_stops
table and you get nothing but an error message.
If we assume that there is a gtfs_stops
table, then your trip_seq
index is already quite optimal for the query.
However, you also need an index for looking up stop_code
values in the gtfs_stops
column.