-
Notifications
You must be signed in to change notification settings - Fork 20
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
Optimize admin queries #110
Conversation
Thanks for this @henribru ! For the ChangeList, it works very well. It works very well for me, with and without the :
So I'm not completely sure about the use of this. Could you please explain? For the ChangeForm, I still have n+1 query on |
In fact I don't really know what is the specificity & role of |
The default implementation of
Probably, I didn't focus on optimizing |
I've been doing some testing on a production app where there are millions of The |
So I checked, the calls responsible for the But as you say, we can live with those |
What about implementing your idea, but without declaring
and then we don't need the extra 2 lines:
It seems to work fine for me |
Ah, I see what you mean. I thought maybe if I annotated |
because of the cached_property decorator, the system first looks into the cache if there is already a value. When you annotate, you store data for a given property into the cache ... so you fill up the cache |
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
==========================================
+ Coverage 83.92% 84.11% +0.18%
==========================================
Files 40 41 +1
Lines 840 850 +10
==========================================
+ Hits 705 715 +10
Misses 135 135
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Contributed by https://github.com/henribru in #110
Okay, great! Though if you could add me as a co-author on the commit with the syntax shown in https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors that'd be nice |
Contributed by https://github.com/henribru in #110 Co-authored-by: henribru <https://github.com/henribru>
Good idea: Done see: https://github.com/boxine/django-huey-monitor/pull/114/commits |
@jedie Don't think it quite worked, when it does it should show both me and you as authors, random example from another repo: I think it's because you used a link to my profile in the brackets instead of an email address. You can use the one from my commits in this branch, i.e. 6639509+henribru@users.noreply.github.com |
Contributed by https://github.com/henribru in #110 Co-authored-by: henribru <6639509+henribru@users.noreply.github.com>
Thanks, appreciate it! |
Fixes #88
With these changes the number of queries should now be constant and independent of the number and nature of the tasks.
I must say, the make file in this repository is excellent! It makes contributing very simple.
Before:
After: