optimize query
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Failing after 6m2s

This commit is contained in:
Nicholas Orlowsky 2025-09-24 18:55:06 -04:00
parent 0593f14408
commit 775d6c2899
No known key found for this signature in database
GPG key ID: A9F3BA4C0AA7A70B
2 changed files with 7 additions and 5 deletions

View file

@ -120,7 +120,7 @@ pub async fn get_schedule_by_route_id(
septa_stop_schedules.route_id,
septa_stops.name as stop_name,
trip_id,
service_id,
septa_stop_schedules.service_id,
septa_stop_schedules.direction_id,
arrival_time,
stop_id,
@ -129,10 +129,12 @@ pub async fn get_schedule_by_route_id(
septa_stop_schedules
INNER JOIN septa_stops
ON septa_stops.id = septa_stop_schedules.stop_id
INNER JOIN septa_schedule_days
ON septa_schedule_days.date = $2
AND
septa_schedule_days.service_id = septa_stop_schedules.service_id
WHERE
septa_stop_schedules.route_id = $1
AND
service_id IN (SELECT service_id FROM septa_schedule_days WHERE date = $2)
;"#,
id.clone(),
schedule_day_str.clone()