-- tested with MySQL 5.6 EXPLAIN SELECT name, status, price FROM history WHERE name = 'foo'; EXPLAIN SELECT name, status, price FROM history WHERE name != 'foo';
id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | history | null | ref | name_timestamp_idx,name_status_idx | name_timestamp_idx | 767 | const | 201 | 100 | null |
id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | history | null | ALL | name_timestamp_idx,name_status_idx | null | null | null | 1407 | 85.71 | Using where |