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

Recommendation feed is unbearably slow. #884

Closed
leonardr opened this issue Mar 13, 2018 · 0 comments
Closed

Recommendation feed is unbearably slow. #884

leonardr opened this issue Mar 13, 2018 · 0 comments
Assignees

Comments

@leonardr
Copy link
Contributor

The recommendation feed gets a bunch of identifiers and then builds a feed out of works equivalent to those identifiers. It uses the fn_recursive_equivalents function on Identifier.id to do that.

The problem is that when you join that against mv_works_for_lanes, the restriction on Identifier.id isn't used to eliminate rows from mv_works_for_lanes based on its identifier_id. This causes a full table scan of the materialized view, which is bad enough to bring down the site if a lot of people are using it.

We've run into something similar for work id and license pool id, and the solution was to add a clause to apply the restriction twice, once on the materialized view and once on the table that was the source for that data.

It's also possible the answer is to use the restricted Identifier.id in the join against the materialized view, rather than to apply the same restriction twice.

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

No branches or pull requests

1 participant