Skip to content
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: introduce an individual physical plan for indexNestedLoopHashJoin #12139

Merged
merged 8 commits into from Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions cmd/explaintest/r/explain_complex.result
Expand Up @@ -123,19 +123,19 @@ Projection_13 1.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Colu
│ ├─IndexScan_25 0.00 cop table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo
│ └─Selection_27 0.00 cop eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27))
│ └─TableScan_26 0.00 cop table:dd, keep order:false, stats:pseudo
└─IndexLookUp_39 3.33 root
├─IndexScan_36 3333.33 cop table:gad, index:t, range:(1478143908,+inf], keep order:false, stats:pseudo
└─Selection_38 3.33 cop eq(Column#2, "android"), not(isnull(Column#5))
└─TableScan_37 3333.33 cop table:gad, keep order:false, stats:pseudo
└─IndexLookUp_41 3.33 root
├─IndexScan_38 3333.33 cop table:gad, index:t, range:(1478143908,+inf], keep order:false, stats:pseudo
└─Selection_40 3.33 cop eq(Column#2, "android"), not(isnull(Column#5))
└─TableScan_39 3333.33 cop table:gad, keep order:false, stats:pseudo
explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext from st gad join dd sdk on gad.aid = sdk.aid and gad.dic = sdk.mac and gad.t < sdk.t where gad.t > 1477971479 and gad.bm = 0 and gad.pt = 'ios' and gad.dit = 'mac' and sdk.t > 1477971479 and sdk.bm = 0 and sdk.pt = 'ios' limit 3000;
id count task operator info
Projection_10 0.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15
└─Limit_13 0.00 root offset:0, count:3000
└─IndexMergeJoin_24 0.00 root inner join, inner:IndexLookUp_22, outer key:Column#3, inner key:Column#21, other cond:eq(Column#6, Column#25), lt(Column#19, Column#27)
├─IndexLookUp_33 0.00 root
│ ├─IndexScan_30 3333.33 cop table:gad, index:t, range:(1477971479,+inf], keep order:false, stats:pseudo
│ └─Selection_32 0.00 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), not(isnull(Column#6))
│ └─TableScan_31 3333.33 cop table:gad, keep order:false, stats:pseudo
├─IndexLookUp_35 0.00 root
│ ├─IndexScan_32 3333.33 cop table:gad, index:t, range:(1477971479,+inf], keep order:false, stats:pseudo
│ └─Selection_34 0.00 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), not(isnull(Column#6))
│ └─TableScan_33 3333.33 cop table:gad, keep order:false, stats:pseudo
└─IndexLookUp_22 0.00 root
├─IndexScan_19 0.00 cop table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo
└─Selection_21 0.00 cop eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27))
Expand All @@ -153,9 +153,9 @@ id count task operator info
Projection_10 0.00 root Column#1, Column#2, Column#4, Column#5, Column#3, Column#24, Column#25, Column#26, Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17
└─Limit_13 0.00 root offset:0, count:2000
└─IndexMergeJoin_25 0.00 root inner join, inner:IndexLookUp_23, outer key:Column#2, Column#5, inner key:Column#21, Column#23
├─TableReader_40 0.00 root data:Selection_39
│ └─Selection_39 0.00 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5))
│ └─TableScan_38 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
├─TableReader_42 0.00 root data:Selection_41
│ └─Selection_41 0.00 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5))
│ └─TableScan_40 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo
└─IndexLookUp_23 0.00 root
├─IndexScan_20 1.25 cop table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true, stats:pseudo
└─Selection_22 0.00 cop eq(Column#22, "ios"), gt(Column#26, 1478185592)
Expand Down Expand Up @@ -245,17 +245,17 @@ id count task operator info
Sort_10 1.00 root Column#31:asc
└─HashAgg_15 1.00 root group by:Column#1, funcs:firstrow(Column#1), firstrow(Column#2), firstrow(Column#3), firstrow(Column#4), firstrow(Column#5), firstrow(Column#6), firstrow(Column#7), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10)
└─Selection_22 0.01 root or(eq(Column#22, 62), or(eq(Column#1, 20), eq(Column#1, 20)))
└─HashLeftJoin_23 0.02 root left outer join, inner:TableReader_68, equal:[eq(Column#11, Column#23)]
└─HashLeftJoin_23 0.02 root left outer join, inner:TableReader_70, equal:[eq(Column#11, Column#23)]
├─IndexMergeJoin_39 0.01 root left outer join, inner:IndexLookUp_37, outer key:Column#1, inner key:Column#17
│ ├─IndexLookUp_58 0.01 root
│ │ ├─IndexScan_55 10.00 cop table:d, index:ctx, range:[1,1], keep order:false, stats:pseudo
│ │ └─Selection_57 0.01 cop eq(Column#8, 1000)
│ │ └─TableScan_56 10.00 cop table:d, keep order:false, stats:pseudo
│ ├─IndexLookUp_60 0.01 root
│ │ ├─IndexScan_57 10.00 cop table:d, index:ctx, range:[1,1], keep order:false, stats:pseudo
│ │ └─Selection_59 0.01 cop eq(Column#8, 1000)
│ │ └─TableScan_58 10.00 cop table:d, keep order:false, stats:pseudo
│ └─IndexLookUp_37 0.00 root
│ ├─Selection_35 1.25 cop not(isnull(Column#17))
│ │ └─IndexScan_33 1.25 cop table:p, index:department_id, range: decided by [eq(Column#17, Column#1)], keep order:true, stats:pseudo
│ └─Selection_36 0.00 cop eq(Column#18, 1000)
│ └─TableScan_34 1.25 cop table:p, keep order:false, stats:pseudo
└─TableReader_68 9.99 root data:Selection_67
└─Selection_67 9.99 cop eq(Column#24, 1000), not(isnull(Column#23))
└─TableScan_66 10000.00 cop table:ep, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_70 9.99 root data:Selection_69
└─Selection_69 9.99 cop eq(Column#24, 1000), not(isnull(Column#23))
└─TableScan_68 10000.00 cop table:ep, range:[-inf,+inf], keep order:false, stats:pseudo
18 changes: 9 additions & 9 deletions cmd/explaintest/r/explain_complex_stats.result
Expand Up @@ -129,9 +129,9 @@ Projection_13 424.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Co
└─Limit_16 424.00 root offset:0, count:2500
└─HashAgg_19 424.00 root group by:Column#23, Column#3, funcs:firstrow(Column#1), firstrow(Column#3), firstrow(Column#4), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10), firstrow(Column#11), firstrow(Column#12), firstrow(Column#13), firstrow(Column#14), firstrow(Column#15), firstrow(Column#19), firstrow(Column#20), firstrow(Column#23), firstrow(Column#26), firstrow(Column#27)
└─IndexMergeJoin_30 424.00 root inner join, inner:IndexLookUp_28, outer key:Column#3, inner key:Column#21, other cond:eq(Column#5, Column#26), gt(Column#27, Column#19)
├─TableReader_35 424.00 root data:Selection_34
│ └─Selection_34 424.00 cop eq(Column#16, 0), eq(Column#2, "android"), gt(Column#19, 1478143908), not(isnull(Column#5))
│ └─TableScan_33 1999.00 cop table:gad, range:[0,+inf], keep order:false
├─TableReader_37 424.00 root data:Selection_36
│ └─Selection_36 424.00 cop eq(Column#16, 0), eq(Column#2, "android"), gt(Column#19, 1478143908), not(isnull(Column#5))
│ └─TableScan_35 1999.00 cop table:gad, range:[0,+inf], keep order:false
└─IndexLookUp_28 0.23 root
├─IndexScan_25 1.00 cop table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true
└─Selection_27 0.23 cop eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27))
Expand All @@ -141,9 +141,9 @@ id count task operator info
Projection_10 170.34 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15
└─Limit_13 170.34 root offset:0, count:3000
└─IndexMergeJoin_24 170.34 root inner join, inner:IndexLookUp_22, outer key:Column#3, inner key:Column#21, other cond:eq(Column#6, Column#25), lt(Column#19, Column#27)
├─TableReader_29 170.34 root data:Selection_28
│ └─Selection_28 170.34 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), gt(Column#19, 1477971479), not(isnull(Column#6))
│ └─TableScan_27 1999.00 cop table:gad, range:[0,+inf], keep order:false
├─TableReader_31 170.34 root data:Selection_30
│ └─Selection_30 170.34 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), gt(Column#19, 1477971479), not(isnull(Column#6))
│ └─TableScan_29 1999.00 cop table:gad, range:[0,+inf], keep order:false
└─IndexLookUp_22 0.25 root
├─IndexScan_19 1.00 cop table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true
└─Selection_21 0.25 cop eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27))
Expand All @@ -161,9 +161,9 @@ id count task operator info
Projection_10 428.32 root Column#1, Column#2, Column#4, Column#5, Column#3, Column#24, Column#25, Column#26, Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17
└─Limit_13 428.32 root offset:0, count:2000
└─IndexMergeJoin_25 428.32 root inner join, inner:IndexLookUp_23, outer key:Column#2, Column#5, inner key:Column#21, Column#23
├─TableReader_40 428.32 root data:Selection_39
│ └─Selection_39 428.32 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5))
│ └─TableScan_38 2000.00 cop table:dt, range:[0,+inf], keep order:false
├─TableReader_42 428.32 root data:Selection_41
│ └─Selection_41 428.32 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5))
│ └─TableScan_40 2000.00 cop table:dt, range:[0,+inf], keep order:false
└─IndexLookUp_23 0.48 root
├─IndexScan_20 1.00 cop table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true
└─Selection_22 0.48 cop eq(Column#22, "ios"), gt(Column#26, 1478185592)
Expand Down