-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: improve out-of-range estimation strategy #26502
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. |
/sig planner |
/run-check_dev_2 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: fe92bb1
|
/merge |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
/merge |
@zhouqiang-cl: In response to this:
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. |
@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. |
"Empty histogram no longer means out-of-range because it's possible that all data is in TopN or all data is NULL." mysql> explain analyze select count(*) from t3 where a between (1) and (2);
+---------------------------+---------+---------+-----------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------+---------+------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+---------------------------+---------+---------+-----------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------+---------+------+
| StreamAgg_10 | 1.00 | 1 | root | | time:3.99ms, loops:2 | funcs:count(1)->Column#3 | 9.49 KB | N/A |
| └─IndexReader_15 | 0.00 | 1024 | root | | time:3.92ms, loops:2, cop_task: {num: 1, max: 3.81ms, proc_keys: 0, tot_proc: 3ms, rpc_num: 1, rpc_time: 3.8ms, copr_cache_hit_ratio: 0.00} | index:IndexRangeScan_14 | 2.26 KB | N/A |
| └─IndexRangeScan_14 | 0.00 | 1024 | cop[tikv] | table:t3, index:a_idx(a) | tikv_task:{time:257µs, loops:1024} | range:[1,2], keep order:false | N/A | N/A |
+---------------------------+---------+---------+-----------+--------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------+---------+------+
3 rows in set (0.00 sec) |
/assign @time-and-fate |
What problem does this PR solve?
Issue Number: close #26086
What is changed and how it works?
(*Histograms).outOfRangeRowCount()
)increaseCount
instead ofmodifyCount
.IncreaseFactor
logic only applies to in-the-range part row count, which means we'll first adjust row count usingincreaseFactor
, then add up the our-of-range part row count. (So you'll seeIncreaseFactor
logic moved fromGetRowCountByXXXRanges
intoGetColumnRowCount
andGetRowCount
)Check List
Tests