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

refine range representation on the result of explain #8588

Closed
zz-jason opened this issue Dec 6, 2018 · 1 comment
Closed

refine range representation on the result of explain #8588

zz-jason opened this issue Dec 6, 2018 · 1 comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.

Comments

@zz-jason
Copy link
Member

zz-jason commented Dec 6, 2018

Feature Request

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:

  • a full range are expressed with [NULL,+inf]
  • a range without any NULL value is expressed with [-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 value

Describe alternatives you've considered:

No

Teachability, Documentation, Adoption, Migration Strategy:

No

@zz-jason
Copy link
Member Author

It's the same issue with #9231. For the same reason #9231 (comment), I'm going to close it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

1 participant