By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table mytable(id int, created_at datetime);
explain select created_at from mytable where created_at >= '2020-05-15 23:00:00';
id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | mytable | null | ALL | null | null | null | null | 1 | 100.00 | Using where |
create index idx_mytable_created_at on mytable(created_at);
Records: 0 Duplicates: 0 Warnings: 0
explain select created_at from mytable where created_at >= '2020-05-15 23:00:00';
id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | mytable | null | index | idx_mytable_created_at | idx_mytable_created_at | 6 | null | 1 | 100.00 | Using where; Using index |