-
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 to use cost model2 #38875
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. |
@@ -65,11 +65,11 @@ | |||
"Result": [ | |||
"HashJoin 4166.67 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", | |||
"├─TableReader(Build) 3333.33 root data:Selection", | |||
"│ └─Selection 3333.33 cop[tikv] gt(test.t1.a, 1), not(isnull(test.t1.a))", |
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.
Both sides are accepted since they have the same est-row 3333.33.
@@ -160,13 +160,13 @@ | |||
], | |||
"Plan": [ | |||
"Limit 1.00 root offset:0, count:1", | |||
"└─IndexJoin 1.00 root left outer semi join, inner:IndexReader, outer key:test.t.a, inner key:test.t.b, equal cond:eq(test.t.a, test.t.b)", |
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 since cost of IndexJoin is under-estimated in model1.
"IndexLookUp(Index(t.e)[[1,1]], Table(t))->HashAgg", | ||
"TableReader(Table(t)->Sel([gt(test.t.e, 1)])->HashAgg)->HashAgg", | ||
"IndexLookUp(Index(t.b)[[-inf,20]], Table(t)->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.
Expected since cost of IndexLookup is under-estimated in model1.
"StreamAgg_12 1.00 47.30 root funcs:count(1)->Column#4", | ||
"└─TableReader_21 0.00 47.30 root data:Selection_20", | ||
" └─Selection_20 0.00 709.52 cop[tikv] eq(test.t2.a, 0)", | ||
" └─TableFullScan_19 3.00 559.82 cop[tikv] table:t2 keep order:false" |
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 since model2 prefers to use TiKV-Scan instead of TiFlash-Scan when est-row is small.
" └─TableReader_22 3.00 6.56 root data:Selection_21", | ||
" └─Selection_21 3.00 54.00 cop[tiflash] not(isnull(test.t1.a))", | ||
" └─TableFullScan_20 3.00 45.00 cop[tiflash] table:t1 keep order:false" | ||
"StreamAgg_10 1.00 630.77 root funcs:count(1)->Column#7", |
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.
The following five cases have no plan change.
/run-build |
@@ -1356,7 +1357,7 @@ func TestIndexLookupJoin(t *testing.T) { | |||
tk.MustExec("analyze table s;") | |||
|
|||
tk.MustQuery("desc format = 'brief' select /*+ TIDB_INLJ(s) */ count(*) from t join s use index(idx) on s.a = t.a and s.b < t.b").Check(testkit.Rows( | |||
"HashAgg 1.00 root funcs:count(1)->Column#6", |
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 since model2 prefers to use StreamAgg instead of HashAgg if no much data to process.
/merge |
This pull request has been accepted and is ready to merge. Commit hash: b3bde8a
|
/merge |
/run-unit-test |
/merge |
/merge |
TiDB MergeCI notify🔴 Bad News! [2] CI still failing after this pr merged.
|
What problem does this PR solve?
Issue Number: ref #35240
Problem Summary: planner: update some UTs to use cost model2
What is changed and how it works?
planner: update some UTs to use cost model2
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.