Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3.9
-
None
Description
explain select `payment_uid`,`date`,`simulation_state`
|
from `stock`
|
where `date` >= '2017-05-31 22:00:00' and `date` <= '2018-05-31 22:00:00' order by date desc;
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
| 1 | SIMPLE | stock | ALL | date | NULL | NULL | NULL | 233416309 | Using where; Using filesort |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
1 row in set (0.01 sec)
|
explain select `payment_uid`,`date`,`simulation_state`
|
from `stock`
|
where `date` >= '2017-05-31 22:00:00' and `date` <= '2018-05-31 22:00:00' order by date ;
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
| 1 | SIMPLE | stock | ALL | date | NULL | NULL | NULL | 233416309 | Using where; Using filesort |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-----------------------------+
|
1 row in set (0.00 sec)
|
explain select `payment_uid`,`date`,`simulation_state`
|
from `stock`
|
where `date` >= '2017-05-31 22:00:00' and `date` <= '2018-05-31 22:00:00';
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-------------+
|
| 1 | SIMPLE | stock | ALL | date | NULL | NULL | NULL | 233416309 | Using where |
|
+------+-------------+-------+------+---------------+------+---------+------+-----------+-------------+
|
1 row in set (0.00 sec)
|
DDL is
`date` datetime DEFAULT NULL,
KEY `date` (`date`),
Important step to reproduce ,
We copy a 10.1.24 datadir and used mysql_upgrade -s
The filtered range is 120M rows
(psergey edited a bit to improve readability)
Attachments
Issue Links
- relates to
-
MDEV-17436 Add new meta system configuration variables
- Open
-
MDEV-4932 query with order by on indexed column is using filesort
- Closed