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

Remove n+1 queries from conference index and conference show pages #501

Merged
merged 7 commits into from
Apr 26, 2024

Conversation

andrewmile
Copy link
Collaborator

This PR removes n+1 queries with the following solutions:

  • The count of open issues is now being loaded on the conferences index and show pages
  • Submissions are now loaded on the conferences index page
  • Each talk's current revision is now loaded on the conferences index and show pages
  • The talk of the current revision is set as a relation on the conference show page

This results in the following query count reduction when testing locally:

Page Before After
Conference list 80 1
Conference show 2 2
Conference list (auth) 163 6
Conference show 125 7

@andrewmile andrewmile self-assigned this Apr 26, 2024
@mattstauffer
Copy link
Member

Looks good to me! Great work, and I really appreciate extracting the currentVersion; it's somethign I know to do today, thanks to some wonderful database teachers and new Eloquent features, but could only wish for back when I wrote this. (I think I wrote this? And the current() is my fault? lol)

I believe this work was co-authored with @omarrida--since he's not marked as a co-author (that's fine, i forget often too), just wanted to credit him in this PR for future knowledge.

@andrewmile andrewmile merged commit dc32b3e into develop Apr 26, 2024
3 checks passed
@andrewmile andrewmile deleted the ajm/conferences-page-performance branch April 26, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants