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

keep the "old" scalar queries behaviour with offset or limit #15020

Closed
wants to merge 1 commit into from

Conversation

i-just
Copy link
Contributor

@i-just i-just commented May 17, 2024

Description

The performance changes from 0ff4796 are causing slightly different behaviour when running scalar element queries.

The first reported case points out that before 4.9, in the EntryQuery::EVENT_BEFORE_PREPARE, for the scalar queries, the $event->sender->orderBy used to return null, but now it’s returning an empty string.

The second reported case is a combination of search, limit, and orderBy('score') params. Prior to 4.9, running count() on a query that contained all three would still return the total count, but now, it respects the passed-in limit. That’s because, in this case, the prepared subquery contains the IDs of the searched elements and the query that got those IDs respected the set limit. (Using the offset param would result in the same non-total count now.)

I raised a PR to go back to the “old” approach when the query contains offset or limit.

I’m raising this as a draft in case we want to discuss this further in the CMS meeting.

Related issues

#15001

@brandonkelly
Copy link
Member

Resolved via dc36833 while still maintaining the performance improvement.

@brandonkelly brandonkelly deleted the bugfix/15001-scalar-queries branch May 21, 2024 02:36
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.

None yet

2 participants