Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow SSP pagination #610

Closed
irees opened this issue May 27, 2016 · 3 comments
Closed

Slow SSP pagination #610

irees opened this issue May 27, 2016 · 3 comments

Comments

@irees
Copy link
Member

irees commented May 27, 2016

The ordering on most SSP queries can be very slow.

@irees irees self-assigned this May 27, 2016
@irees
Copy link
Member Author

irees commented May 27, 2016

Use of a CTE query for sorting (https://www.postgresql.org/docs/current/static/queries-with.html) can improve performance substantially -- tested with a local dump of prod db. The postgres_ext (https://github.com/DockYard/postgres_ext/blob/master/docs/querying.md) gem adds this support, but it appears to have a conflict with squeel. Investigating.

@drewda
Copy link
Member

drewda commented May 27, 2016

Perhaps of use: CTE support in ARel https://github.com/rails/arel#complex-joins ?

@irees irees closed this as completed in #611 Jun 1, 2016
@drewda
Copy link
Member

drewda commented Jun 2, 2016

This is the query that was taking longer than 2 minutes to complete previously: https://transit.land/api/v1/schedule_stop_pairs?feed_onestop_id=f-drt8-nps~boha~ferries

After @irees 's index changes, it's nice and fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants