forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
planner: support a hint to read from tiflash in planner (pingcap#12479)
- Loading branch information
Showing
47 changed files
with
5,088 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
drop table if exists t, tt; | ||
create table t(a int, b int, index ia(a)); | ||
desc select avg(a) from t; | ||
id count task operator info | ||
StreamAgg_20 1.00 root funcs:avg(Column#8, Column#9) | ||
└─IndexReader_21 1.00 root index:StreamAgg_8 | ||
└─StreamAgg_8 1.00 cop[tikv] funcs:avg(Column#1) | ||
└─IndexScan_19 10000.00 cop[tikv] table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo | ||
desc select /*+ read_from_storage(tiflash[t]) */ avg(a) from t; | ||
id count task operator info | ||
StreamAgg_16 1.00 root funcs:avg(Column#8, Column#9) | ||
└─TableReader_17 1.00 root data:StreamAgg_8 | ||
└─StreamAgg_8 1.00 cop[tiflash] funcs:count(Column#1), sum(Column#1) | ||
└─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
desc select /*+ read_from_storage(tiflash[t]) */ sum(a) from t; | ||
id count task operator info | ||
StreamAgg_16 1.00 root funcs:sum(Column#7) | ||
└─TableReader_17 1.00 root data:StreamAgg_8 | ||
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(Column#1) | ||
└─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
desc select /*+ read_from_storage(tiflash[t]) */ sum(a+1) from t; | ||
id count task operator info | ||
StreamAgg_16 1.00 root funcs:sum(Column#7) | ||
└─TableReader_17 1.00 root data:StreamAgg_8 | ||
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(plus(Column#1, 1)) | ||
└─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
desc select /*+ read_from_storage(tiflash[t]) */ sum(isnull(a)) from t; | ||
id count task operator info | ||
StreamAgg_16 1.00 root funcs:sum(Column#7) | ||
└─TableReader_17 1.00 root data:StreamAgg_8 | ||
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(isnull(Column#1)) | ||
└─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use test; | ||
drop table if exists t; | ||
create table t(a bigint, b bigint); | ||
explain insert into t values(1, 1); | ||
id count task operator info | ||
Insert_1 N/A root N/A | ||
explain insert into t select * from t; | ||
id count task operator info | ||
Insert_1 N/A root N/A | ||
└─TableReader_7 10000.00 root data:TableScan_6 | ||
└─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
explain delete from t where a > 100; | ||
id count task operator info | ||
Delete_3 N/A root N/A | ||
└─TableReader_6 3333.33 root data:Selection_5 | ||
└─Selection_5 3333.33 cop[tikv] gt(Column#1, 100) | ||
└─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
explain update t set b = 100 where a = 200; | ||
id count task operator info | ||
Update_3 N/A root N/A | ||
└─TableReader_6 10.00 root data:Selection_5 | ||
└─Selection_5 10.00 cop[tikv] eq(Column#1, 200) | ||
└─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo | ||
explain replace into t select a, 100 from t; | ||
id count task operator info | ||
Insert_1 N/A root N/A | ||
└─Projection_5 10000.00 root Column#3, 100 | ||
└─TableReader_7 10000.00 root data:TableScan_6 | ||
└─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.