You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which produces a query using a subquery to find operators:
SELECT "current_schedule_stop_pairs".* FROM "current_schedule_stop_pairs" WHERE "current_schedule_stop_pairs"."operator_id" IN (SELECT id FROM "current_operators" WHERE "current_operators"."onestop_id" = 'o-123-81') ORDER BY "current_schedule_stop_pairs"."id" ASC LIMIT 51 OFFSET 0
This is very expensive and can timeout.
Using pluck on Operator.find_by_onestop_ids! (at the cost of a second query) produces a simpler, more efficient, more index-searchable form for the main query:
SELECT "current_schedule_stop_pairs".* FROM "current_schedule_stop_pairs" WHERE "current_schedule_stop_pairs"."operator_id" = 1 ORDER BY "current_schedule_stop_pairs"."id" ASC LIMIT 51 OFFSET 0
Use this form in all SSP query params, and consider expanding to all controllers.
The text was updated successfully, but these errors were encountered:
Using
operator_onestop_id
callsOperator.find_by_onestop_ids!
which produces a query using a subquery to find operators:
This is very expensive and can timeout.
Using
pluck
onOperator.find_by_onestop_ids!
(at the cost of a second query) produces a simpler, more efficient, more index-searchable form for the main query:Use this form in all SSP query params, and consider expanding to all controllers.
The text was updated successfully, but these errors were encountered: