MariaDB [schema]> explain select count(*) from message where when_updated between '2019-03-31 01:00:00' and '2019-03-31 01:00:01';
|
+------+-------------+---------+-------+---------------+--------------+---------+------+----------+--------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+---------+-------+---------------+--------------+---------+------+----------+--------------------------+
|
| 1 | SIMPLE | message | index | when_updated | when_updated | 4 | NULL | 17206865 | Using where; Using index |
|
+------+-------------+---------+-------+---------------+--------------+---------+------+----------+--------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [schema]> explain select count(*) from message where when_updated between '2019-03-31 00:00:59' and '2019-03-31 00:00:59';
|
+------+-------------+---------+------+---------------+--------------+---------+-------+------+--------------------------+
|
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
+------+-------------+---------+------+---------------+--------------+---------+-------+------+--------------------------+
|
| 1 | SIMPLE | message | ref | when_updated | when_updated | 4 | const | 1 | Using where; Using index |
|
+------+-------------+---------+------+---------------+--------------+---------+-------+------+--------------------------+
|
1 row in set (0.02 sec)
|