-
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
statistics: handle contants in Selectivity()
#32761
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/81733e7387746600701ef1423da66c855e037f92 |
└─HashAgg 1.00 root group by:Column#32, Column#33, Column#34, funcs:count(1)->Column#31 | ||
└─Projection 0.01 root Column#14, Column#15, coalesce(test.test02.region_name, 不详)->Column#34 | ||
└─IndexJoin 0.01 root left outer join, inner:TableReader, outer key:Column#16, inner key:test.test02.id, equal cond:eq(Column#16, test.test02.id) | ||
├─Union(Build) 0.01 root | ||
│ ├─TableDual 0.00 root rows:0 | ||
│ └─Projection 0.01 root test.test01.stat_date, test.test01.show_date, test.test01.region_id | ||
│ └─TableReader 0.01 root data:Selection | ||
│ └─Selection 0.01 cop[tikv] eq(test.test01.period, 1), ge(test.test01.stat_date, 20191202), gt(cast(test.test01.registration_num, bigint(20) BINARY), 0), le(test.test01.stat_date, 20191202) | ||
│ └─TableFullScan 10000.00 cop[tikv] table:test01 keep order:false, stats:pseudo | ||
└─TableReader(Probe) 1.00 root data:TableRangeScan | ||
└─TableRangeScan 1.00 cop[tikv] table:b range: decided by [Column#16], keep order:false, stats:pseudo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change essentially reverts the changes in #21061.
Detail: https://github.com/pingcap/tidb/pull/21061/files#diff-b2102aac708eea9196b2b098c7484d1e70e76b864e2eaa28978a231419fe6a55.
I think it's expected and acceptable.
And because test cases here don't load real stats, this change doesn't make much sense.
@@ -279,6 +279,15 @@ id estRows task access object operator info | |||
TableReader_7 804024.75 root data:Selection_6 | |||
└─Selection_6 804024.75 cop[tikv] or(and(eq(imdbload.char_name.imdb_index, "I"), lt(imdbload.char_name.surname_pcode, "E436")), and(eq(imdbload.char_name.imdb_index, "L"), lt(imdbload.char_name.surname_pcode, "E436"))) | |||
└─TableFullScan_5 4314864.00 cop[tikv] table:char_name keep order:false | |||
explain select * from char_name use index (itest2) where ((imdb_index = 'I') and (surname_pcode < 'E436')) or ((imdb_index = 'L') and (surname_pcode < 'E436')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here are irrelevant to this PR. My next PR will need these test results for comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 11ce2c9
|
@time-and-fate: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #32835 ref #32758
Problem Summary: Please see the issue and test cases for detail.
What is changed and how it works?
Handle contants in
Selectivity()
.Check List
Tests
Side effects
Documentation
Release note