Representer link counts introduce N+1 queries
Opened this issue · 0 comments
cavis commented
We've been gradually tracking down / fixing N+1 queries via joins()
and includes()
. One are not tackled yet: link counts. For our internal users with 100s of accounts (ad-ops, support), this can be prohibitively slow.
Options:
- Tackle this with with caching (first query could still be real slow)
- Write a bunch of custom SQL to eager-load and hydrate those counts
- Use a query param similar to "zoom" to indicate if you want the counts returned or not
- Just remove counts from all the links (and fix Publish to work with that ... making a 2nd GET if it needs the count)