-
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
CAST which only changes the length of the string type column will cause full scan instead of index seek #45199
Comments
The initial plan before predicate-push-down will be like |
The If we don't write UNION, just write |
A possible solution is that we directly modify the ranger, detect the CASTs which only change the length, and construct an index range for them |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t1(a varchar(100) primary key);
create table t2(a varchar(10) primary key);
create view v as select a from t1 union select a from t2;
explain select * from v where a='test';
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: