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

Improve string query parsing flow. #3321

Closed
wants to merge 2 commits into from
Closed

Conversation

christophstrobl
Copy link
Member

@christophstrobl christophstrobl commented Jan 18, 2024

Resolves: #3310, #3311

* @since 3.2.3
* @author Christoph Strobl
*/
static class CachableQuery {
Copy link
Member

Choose a reason for hiding this comment

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

The caching key is already quite complex. I'd suggest to keep only the isUnsorted code path and refine the way we render queries with a sort. That is, render everything before and after ORDER BY in a first pass (e.g. held in a QueryEnhancer instance). Then, render Sort with rather simple string concatenation.

Copy link
Member Author

Choose a reason for hiding this comment

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

The above is deliberately targeting the 3.2.x line without applying major changes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #3326 to follow up on splitting the transformation (targeting main development line)

This commit makes sure to avoid unnecessary parsing of queries when sorting must not be appended.
Additionally the parsed result is cached on a per query string with sort expression basis to avoid parsing repeating occurrences of the same expressions eg. while paging through results.
@christophstrobl christophstrobl marked this pull request as ready for review January 19, 2024 11:09
mp911de pushed a commit that referenced this pull request Feb 14, 2024
This commit makes sure to avoid unnecessary parsing of queries when sorting must not be appended.
Additionally the parsed result is cached on a per query string with sort expression basis to avoid parsing repeating occurrences of the same expressions eg. while paging through results.

Closes: #3310
Original pull request: #3321
mp911de added a commit that referenced this pull request Feb 14, 2024
Avoid unconditional ConcurrentLruCache instances for each String-based query.

See: #3310
Original pull request: #3321
mp911de pushed a commit that referenced this pull request Feb 14, 2024
This commit makes sure to avoid unnecessary parsing of queries when sorting must not be appended.
Additionally the parsed result is cached on a per query string with sort expression basis to avoid parsing repeating occurrences of the same expressions eg. while paging through results.

Closes: #3310
Original pull request: #3321
mp911de added a commit that referenced this pull request Feb 14, 2024
Avoid unconditional ConcurrentLruCache instances for each String-based query.

See: #3310
Original pull request: #3321
@mp911de mp911de linked an issue Feb 14, 2024 that may be closed by this pull request
@mp911de mp911de added the type: task A general task label Feb 14, 2024
@mp911de mp911de added this to the 3.2.3 (2023.1.3) milestone Feb 14, 2024
@mp911de mp911de closed this Feb 14, 2024
@mp911de mp911de deleted the issue/3.2.x/3310 branch February 14, 2024 08:14
mp911de added a commit that referenced this pull request Feb 14, 2024
Avoid unconditional ConcurrentLruCache instances for each String-based query.

See: #3310
Original pull request: #3321
mp911de added a commit that referenced this pull request Feb 14, 2024
Avoid unconditional ConcurrentLruCache instances for each String-based query.

See: #3310
Original pull request: #3321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid string query parsing when sorting must not be applied
2 participants