Closed zz-jason closed 4 years ago
At present, the range representation is a little confusing:
TiDB(root@127.0.0.1:test) > explain select * from t use index(idx); +-------------------+-------+------+---------------------------------------------------------------------+ | id | count | task | operator info | +-------------------+-------+------+---------------------------------------------------------------------+ | IndexReader_5 | 2.00 | root | index:IndexScan_4 | | └─IndexScan_4 | 2.00 | cop | table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo | +-------------------+-------+------+---------------------------------------------------------------------+ 2 rows in set (0.00 sec) TiDB(root@127.0.0.1:test) > explain select * from t use index(idx) where a is not null; +-------------------+-------+------+---------------------------------------------------------------------+ | id | count | task | operator info | +-------------------+-------+------+---------------------------------------------------------------------+ | IndexReader_6 | 2.00 | root | index:IndexScan_5 | | └─IndexScan_5 | 2.00 | cop | table:t, index:a, range:[-inf,+inf], keep order:false, stats:pseudo | +-------------------+-------+------+---------------------------------------------------------------------+ 2 rows in set (0.00 sec)
as you can see in the above:
[NULL,+inf]
[-inf,+inf]
Describe the feature you'd like:
Can we regard NULL as the smallest value:
NULL
[NULL,+inf)
(NULL, +inf)
Describe alternatives you've considered:
No
Teachability, Documentation, Adoption, Migration Strategy:
It's the same issue with https://github.com/pingcap/tidb/issues/9231. For the same reason https://github.com/pingcap/tidb/issues/9231#issuecomment-600094541, I'm going to close it as well.
Feature Request
At present, the range representation is a little confusing:
as you can see in the above:
[NULL,+inf]
[-inf,+inf]
Describe the feature you'd like:
Can we regard
NULL
as the smallest value:[NULL,+inf)
to express a full range(NULL, +inf)
to express a range without NULL valueDescribe alternatives you've considered:
No
Teachability, Documentation, Adoption, Migration Strategy:
No