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
Dashboard: optimize projects queryset (constant number of queries) (#12385)
This is on top of
#12383 as another PR
in case we see a regression in performance, it would be easier to just
revert this change.
Instead of pre-fetching, we annotate, so we can use exist instead of
fetching the query. This allows to just make one query. But this does
add some extra complexity to the query itself, which is less overhead
than doing a prefetch over the queryset itself, but the pagination
package we are using calls .count(), and django includes the annotation
by default... which makes that query slower as well... but testing in
production shows faster results still.
0 commit comments