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

Representer link counts introduce N+1 queries #577

Open
cavis opened this issue Dec 11, 2020 · 0 comments
Open

Representer link counts introduce N+1 queries #577

cavis opened this issue Dec 11, 2020 · 0 comments
Labels

Comments

@cavis
Copy link
Member

cavis commented Dec 11, 2020

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)
@cavis cavis added the high label Dec 14, 2020
@cavis cavis added this to the Sprint Zion milestone Dec 14, 2020
@cavis cavis added medium and removed high labels Jan 5, 2021
@cavis cavis removed this from the Sprint Zion milestone Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant