-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
prepared plan cache support point get plan with extra filter #28664
Comments
This issue can be solved by #28478:
But the cached plan is
There is still some room for improvement like caching a |
Consider this kind of queries is common, now the plan changed from point get to index lookup, one round trip becomes two round trips, we should cache |
For none clustered indexes table, the change of #28478 should bring little performance change, either original test case
output
|
A range predicates on the primary key(clustered key) becomes full table scan, either prepared or not, not sure it's expected.
|
Enhancement
Currently the prepared plan cache does not support point get plan with extra filter.
select bankno, c1, c2 from t WHERE c1= ?
can be cachedselect bankno, c1, c2 from t WHERE c1= ? and c2 = ?
can not be cached.(c1,c2)
, thenselect bankno, c1, c2 from t WHERE c1= ? and c2 = ? and c3 = ?
can not be cached(c1,c2)
, thenselect bankno, c1, c2 from t WHERE c1= ? and c3 = ?
can be cachedselect bankno, c1, c2 from t WHERE c1= 'abc' and c2 = '1'
can not be cached;select bankno, c1, c2 from t WHERE c1= 'abc'
can be cached.The text was updated successfully, but these errors were encountered: