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

[SHARE-1000][Fix] Speed up fetch query in indexer #727

Conversation

aaxelb
Copy link
Contributor

@aaxelb aaxelb commented Nov 17, 2017

Once the query reached a certain number of joins, Postgres would (apparently) do all the joins for every work in the database, then apply the WHERE filter after the fact.

This change explicitly filters the works in a subquery before joining anything to it, so Postgres doesn't have the power to make such bad life choices.

@aaxelb aaxelb merged commit b6bf925 into CenterForOpenScience:develop Nov 17, 2017
@aaxelb aaxelb deleted the fix/SHARE-1000--how-about-not-slowly branch November 17, 2017 15:03
@coveralls
Copy link

Coverage Status

Coverage remained the same at 78.648% when pulling 79a199e on aaxelb:fix/SHARE-1000--how-about-not-slowly into 737ee1d on CenterForOpenScience:develop.

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

Successfully merging this pull request may close these issues.

None yet

3 participants