-
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
planner: update some UTs from cost model1 to model2 #39013
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. |
@@ -7110,26 +7114,26 @@ func TestAggWithJsonPushDownToTiFlash(t *testing.T) { | |||
} | |||
|
|||
rows := [][]interface{}{ | |||
{"HashAgg_6", "root", "funcs:avg(Column#4)->Column#3"}, |
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.
Expected, no plan change, just update Operator ID.
@@ -384,12 +384,12 @@ | |||
" │ └─TableFullScan 10.00 cop[tikv] table:t keep order:false", | |||
" └─StreamAgg(Probe) 10.00 root funcs:count(1)->Column#21", | |||
" └─HashJoin 10.00 root inner join, equal:[eq(test.t.a, test.t.a)]", | |||
" ├─TableReader(Build) 10.00 root data:Selection", |
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.
Expected, IndexScan is always better than TableScan.
@@ -1964,21 +1964,20 @@ | |||
{ | |||
"SQL": "select * from t where a > 1 order by f", | |||
"Plan": [ | |||
"IndexLookUp_14 3333.33 136747.00 root ", |
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.
Expected, model2 prefers to use single-read Scan instead of double-read Lookup if not much data to access.
"StreamAgg 1.00 root funcs:avg(Column#7, Column#8)->Column#4", | ||
"└─IndexReader 1.00 root index:StreamAgg", | ||
" └─StreamAgg 1.00 cop[tikv] funcs:count(test.t.a)->Column#7, funcs:sum(test.t.a)->Column#8", | ||
"HashAgg 1.00 root funcs:avg(Column#5, Column#6)->Column#4", |
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.
Expected, HashAgg is better since there are lots of rows(10000) to process.
@@ -963,31 +963,31 @@ | |||
}, | |||
{ | |||
"SQL": "select sum(e), avg(e + c) from t where c = 1 group by e", | |||
"Best": "IndexReader(Index(t.c_d_e)[[1,1]]->HashAgg)->HashAgg" |
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.
Whether to push Agg down to TikV when small data size is a little unstable.
It will be resolved by #38874.
" └─ExchangeReceiver_18 10000.00 mpp[tiflash] ", | ||
" └─ExchangeSender_17 10000.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.employee.deptid, collate: binary]", | ||
" └─TableFullScan_16 10000.00 mpp[tiflash] table:employee keep order:false, stats:pseudo" | ||
" └─Projection_21 8000.00 mpp[tiflash] Column#5", |
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.
Expected, 2PhaseAgg is better.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b4eab94
|
/run-mysql-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1fc6491
|
/run-check_dev_2 |
TiDB MergeCI notify🔴 Bad News! [3] CI still failing after this pr merged.
|
What problem does this PR solve?
Issue Number: ref #35240
Problem Summary: planner: update some UTs from cost model1 to model2
What is changed and how it works?
planner: update some UTs from cost model1 to model2
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.