46 lines
2.6 KiB
Plaintext
46 lines
2.6 KiB
Plaintext
set tidb_cost_model_version=1;
|
|
CREATE TABLE `access_path_selection` (
|
|
`a` int,
|
|
`b` int,
|
|
KEY `IDX_a` (`a`),
|
|
KEY `IDX_b` (`b`),
|
|
KEY `IDX_ab` (`a`, `b`)
|
|
);
|
|
explain format = 'plan_tree' select a from access_path_selection where a < 3;
|
|
id task access object operator info
|
|
IndexReader root index:IndexRangeScan
|
|
└─IndexRangeScan cop[tikv] table:access_path_selection, index:IDX_a(a) range:[-inf,3), keep order:false, stats:pseudo
|
|
explain format = 'plan_tree' select a, b from access_path_selection where a < 3;
|
|
id task access object operator info
|
|
IndexReader root index:IndexRangeScan
|
|
└─IndexRangeScan cop[tikv] table:access_path_selection, index:IDX_ab(a, b) range:[-inf,3), keep order:false, stats:pseudo
|
|
explain format = 'plan_tree' select a, b from access_path_selection where b < 3;
|
|
id task access object operator info
|
|
TableReader root data:Selection
|
|
└─Selection cop[tikv] lt(access_path_selection.access_path_selection.b, 3)
|
|
└─TableFullScan cop[tikv] table:access_path_selection keep order:false, stats:pseudo
|
|
explain format = 'plan_tree' select a, b from access_path_selection where a < 3 and b < 3;
|
|
id task access object operator info
|
|
IndexReader root index:Selection
|
|
└─Selection cop[tikv] lt(access_path_selection.access_path_selection.b, 3)
|
|
└─IndexRangeScan cop[tikv] table:access_path_selection, index:IDX_ab(a, b) range:[-inf,3), keep order:false, stats:pseudo
|
|
explain format = 'plan_tree' select a, b from access_path_selection where a > 10 order by _tidb_rowid;
|
|
id task access object operator info
|
|
Projection root access_path_selection.access_path_selection.a, access_path_selection.access_path_selection.b
|
|
└─TableReader root data:Selection
|
|
└─Selection cop[tikv] gt(access_path_selection.access_path_selection.a, 10)
|
|
└─TableFullScan cop[tikv] table:access_path_selection keep order:true, stats:pseudo
|
|
explain format = 'plan_tree' select max(_tidb_rowid) from access_path_selection;
|
|
id task access object operator info
|
|
StreamAgg root funcs:max(access_path_selection.access_path_selection._tidb_rowid)->Column
|
|
└─Limit root offset:0, count:1
|
|
└─TableReader root data:Limit
|
|
└─Limit cop[tikv] offset:0, count:1
|
|
└─TableFullScan cop[tikv] table:access_path_selection keep order:true, desc, stats:pseudo
|
|
explain format = 'plan_tree' select count(1) from access_path_selection;
|
|
id task access object operator info
|
|
StreamAgg root funcs:count(Column)->Column
|
|
└─TableReader root data:StreamAgg
|
|
└─StreamAgg cop[tikv] funcs:count(1)->Column
|
|
└─TableFullScan cop[tikv] table:access_path_selection keep order:false, stats:pseudo
|