NEW: ExpressionList has clear() method #2941
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had an issue in our application, where we had a (complex) query and we wanted to get only a subset of models for paging in a web app, where we had the IDs. Here is a use case, why we need this and cannot rebuild the query.
Use case
We have really slow queries here (complex searches, especially in non indexed fields could take up several seconds), but then we have the whole search result in memory (we store only the IDs, so not to run in an OOM), then we display the results in the browser.
In theory, the ID queries should be superfast, but not always, Especially on MariaDB, we discvered some cases, that the query-optimizer not always starts with the
id in (?, ?)
clause, but with some other conditions, which makes the query slow.So we removed the old where conditions with
and the query is fast again.
(Yes, we know, that data can change during paging, but this is not a problem in our use case)