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

The slow_query view uses the date field as a where condition, where the position of time is different (but equivalent), and the dates in the execution plan are different #57547

Open
eastsunmoon opened this issue Nov 20, 2024 · 0 comments · May be fixed by #57562
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@eastsunmoon
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use information_schema;
mysql> explain select count(*) from slow_query where '2024-11-20 12:41:45' < time ;
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
| HashAgg_6 | 1.00 | root | | funcs:count(1)->Column#80 |
| └─MemTableScan_8 | 10000.00 | root | table:SLOW_QUERY | start_time:2024-11-19 12:41:44.999000, end_time:2024-11-20 12:41:44.999000 |
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> explain select count(*) from slow_query where time > '2024-11-20 12:41:45' ;
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
| HashAgg_6 | 1.00 | root | | funcs:count(1)->Column#80 |
| └─MemTableScan_8 | 10000.00 | root | table:SLOW_QUERY | start_time:2024-11-20 12:41:45.001000, end_time:2024-11-21 12:41:45.001000 |
+----------------------+----------+------+------------------+----------------------------------------------------------------------------+
2 rows in set (0.00 sec)

2. What did you expect to see? (Required)

the dates in the execution plan are same.

3. What did you see instead (Required)

The slow_query view uses the date field as a where condition, where the position of time is different (but equivalent), and the dates in the execution plan are different

4. What is your TiDB version? (Required)

mysql> select version();
+--------------------+
| version() |
+--------------------+
| 8.0.11-TiDB-v7.5.2 |
+--------------------+
1 row in set (0.00 sec)

@eastsunmoon eastsunmoon added the type/bug The issue is confirmed as a bug. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants