Mar 07, 2017 13:40
И всё то у них так
mysql> explain select uid from log l where '2016-12-31' <= l.startday ;
+----+-------------+-------+-------+---------------+----------+---------+------+---------+-----------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+-------+---------------+----------+---------+------+---------+-----------------------+
| 1 | SIMPLE | l | range | startday | startday | 3 | NULL | 8370032 | Using index condition |
+----+-------------+-------+-------+---------------+----------+---------+------+---------+-----------------------+
1 row in set (0,00 sec)
mysql> explain select uid from log l where '2016-11-31' <= l.startday ;
+----+-------------+-------+------+---------------+------+---------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+----------+-------------+
| 1 | SIMPLE | l | ALL | startday | NULL | NULL | NULL | 65140960 | Using where |
+----+-------------+-------+------+---------------+------+---------+------+----------+-------------+
1 row in set (0,21 sec)
mysql