You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case where nplusone first complains that a prefetch_related is missing and once I add that it complains that the new prefetch_related is over-eager.
In more detail:
The related part of the model is:
Three Models: P, N and U
Query starts at P, i.e. P.objects.[..]
P has an m2m relation to N
N has a foreign key towards U
Initial error is: Potential n+1 query detected on "N.u"
Once I add .prefetch_related('n__u') it changes to: Potential unnecessary eager load detected on "P.n"
Any thoughts other than whitelisting for a workaround?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi!
I have a case where nplusone first complains that a
prefetch_related
is missing and once I add that it complains that the newprefetch_related
is over-eager.In more detail:
P.objects.[..]
Potential n+1 query detected on "N.u"
.prefetch_related('n__u')
it changes to:Potential unnecessary eager load detected on "P.n"
Any thoughts other than whitelisting for a workaround?
Thanks in advance!
The text was updated successfully, but these errors were encountered: