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

DB Optimization for save and validate #17

Merged
merged 1 commit into from
Mar 21, 2013
Merged

Conversation

nicpottier
Copy link
Contributor

We have one big install that uses XForms and it was starting to get pretty slow. Upon further investigation, the cause was the save() and validate_attributes() methods in EAV, which due to getattr overloading were causing single DB queries for every attribute on an entity for each save. (actually * 2 because it was taking place both in save and validate)

For XForm installs with many forms and many fields this was turning into hundreds of single DB queries for every save.

This optimizes things by getting all the db values for an entity all at once when doing validation and saving.

Passes the django-eav tests as well as the very rigorous tests we have for that project, so I think it is an easy win for anybody.

dorey added a commit that referenced this pull request Mar 21, 2013
DB Optimization for save and validate
@dorey dorey merged commit 27c2121 into mvpdev:master Mar 21, 2013
@dorey
Copy link
Member

dorey commented Mar 21, 2013

Hi @nicpottier. This repo is not actively being managed at the moment. We've given you commit rights to the repo. Thanks for the optimizations.

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.

2 participants