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

fix(galleries): more efficient queries #1098

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

AW0005
Copy link
Contributor

@AW0005 AW0005 commented Oct 29, 2024

Making a couple more gallery related queries more efficient.

@AW0005 AW0005 marked this pull request as ready for review October 29, 2024 04:29
@AW0005 AW0005 changed the title More Efficient Queries fix(Galleries): more efficient queries Oct 29, 2024
@AW0005 AW0005 changed the title fix(Galleries): more efficient queries fix(galleries): more efficient queries Oct 29, 2024
@@ -26,7 +26,7 @@
</p>
@endif
<p>{!! $gallery->description !!}</p>
@if (!$gallery->submissions->count() && $gallery->children->count() && $childSubmissions->count())
@if (!$gallery->submissions()->count() && $gallery->children->count() && $childSubmissions->count())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the parenthesis it's pulling all submissions into memory to count them instead of letting sql count them

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was the reverse? Or is there some particular nuance of relation-vs-query I'm missing here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh I see

@itinerare itinerare added the needs review Pull requests that are pending community review label Oct 29, 2024
@itinerare itinerare merged commit 9675699 into corowne:release/v3.0.0 Oct 29, 2024
1 of 6 checks passed
@itinerare itinerare added reviewed Pull requests that have received community review and are pending merge and removed needs review Pull requests that are pending community review labels Oct 29, 2024
SpeedyD added a commit to SpeedyD/lorekeeper that referenced this pull request Oct 30, 2024
…ase-to-dev

* corowne/release/v3.0.0:
  fix(galleries): make some queries more efficient (corowne#1098)
  fix: improve user profile, character page row styling on smaller viewports/mobile (corowne#1099)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed Pull requests that have received community review and are pending merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants