Open wshwsh12 opened 5 years ago
Is your feature request related to a problem? Please describe:
Now the plan built for a range scan on int can be better. e.g.
int
mysql> CREATE TABLE tb (a int1); mysql> Desc select * from tb where a > 200; +---------------------+----------+------+-------------------------------------------------------------+ | id | count | task | operator info | +---------------------+----------+------+-------------------------------------------------------------+ | TableReader_7 | 3333.33 | root | data:Selection_6 | | └─Selection_6 | 3333.33 | cop | gt(test.tb.a, 200) | | └─TableScan_5 | 10000.00 | cop | table:tb, range:[-inf,+inf], keep order:false, stats:pseudo | +---------------------+----------+------+-------------------------------------------------------------+ 3 rows in set (0.00 sec) mysql> Desc select * from tb where a < 200; +---------------------+----------+------+-------------------------------------------------------------+ | id | count | task | operator info | +---------------------+----------+------+-------------------------------------------------------------+ | TableReader_7 | 3323.33 | root | data:Selection_6 | | └─Selection_6 | 3323.33 | cop | lt(test.tb.a, 200) | | └─TableScan_5 | 10000.00 | cop | table:tb, range:[-inf,+inf], keep order:false, stats:pseudo | +---------------------+----------+------+-------------------------------------------------------------+ 3 rows in set (0.00 sec)
Describe the feature you'd like:
The result can be better.
mysql> Desc select * from tb where a > 200; +-------------+-------+------+---------------+ | id | count | task | operator info | +-------------+-------+------+---------------+ | TableDual_6 | 0.00 | root | rows:0 | +-------------+-------+------+---------------+ 1 row in set (0.00 sec) mysql> Desc select * from tb where a < 200; +-------------------+----------+------+-------------------------------------------------------------+ | id | count | task | operator info | +-------------------+----------+------+-------------------------------------------------------------+ | TableReader_6 | 10000.00 | root | data:TableScan_5 | | └─TableScan_5 | 10000.00 | cop | table:tb, range:[-inf,+inf], keep order:false, stats:pseudo | +-------------------+----------+------+-------------------------------------------------------------+ 2 rows in set (0.00 sec)
Describe alternatives you've considered:
No. Teachability, Documentation, Adoption, Migration Strategy:
No.
How to decide whether to use TableDual?
TableDual
Feature Request
Is your feature request related to a problem? Please describe:
Now the plan built for a range scan on
int
can be better. e.g.Describe the feature you'd like:
The result can be better.
Describe alternatives you've considered:
No. Teachability, Documentation, Adoption, Migration Strategy:
No.