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

Improve performance of Search.delete_old_searches #2063

Conversation

danschmidt5189
Copy link
Contributor

@danschmidt5189 danschmidt5189 commented Feb 1, 2019

Closes #2062

Closes projectblacklight#2062

Call delete_all instead of destroy_all to prevent loading relations in
memory. This method is much faster (a single DELETE query) but does not
execute callbacks or delete relations. That's not an issue now, but if
the Search model is extended this method may need to be modified.
@danschmidt5189 danschmidt5189 force-pushed the 2062-delete_old_searches_in_batches branch from d6cdb00 to 6f2748e Compare February 1, 2019 19:16
@danschmidt5189 danschmidt5189 changed the title Reduce memory consumption by batching Search.delete_old_searches Improve performance of Search.delete_old_searches Feb 1, 2019
@danschmidt5189
Copy link
Contributor Author

@jcoyne Updated to use delete_all. I noted the potential problems in the commit message.

@jcoyne jcoyne merged commit 5a62a9a into projectblacklight:master Feb 2, 2019
@jcoyne
Copy link
Member

jcoyne commented Feb 2, 2019

Thanks @danschmidt5189. Great contribution!

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

2 participants