wellkilo opened a new pull request, #69613:
URL: https://github.com/apache/doris/pull/69613
### What problem does this PR solve?
Issue Number: close #69553
Problem Summary:
SQL cache was disabled whenever `sql_select_limit` or
`default_order_by_limit` was set, even though both variables are marked with
`affectQueryResultInExecution` and are already compared through
`SqlCacheContext` when a cached result is looked up. JDBC clients such as
Metabase use `sql_select_limit` for `Statement.setMaxRows`, so common dashboard
queries never used the SQL cache.
This change removes the redundant eligibility checks. Queries with positive
limit values can now use SQL cache, and changing either limit value changes the
affected-query-result variable set, so a result cached with one limit cannot be
reused for another.
### Release note
Enable SQL cache for queries with positive `sql_select_limit` or
`default_order_by_limit` values.
### Check List (For Author)
- Test
- [x] Unit Test
- Added coverage in `SqlCacheTest` for positive limit values and
cache-context isolation.
- The test compiles and runs in upstream CI; Java and Maven are not
installed in the contributor's current local environment.
- [x] `git diff --check`
- Behavior changed:
- [x] Yes. Queries with positive limit values can now use SQL cache
results isolated by the full affected-query-result variable set.
- Does this need documentation?
- [x] No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]