Two tables are given:
CREATE TABLE `cities` ( `city_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `enabled` ENUM('0','1') NULL DEFAULT NULL, `domain` VARCHAR(100) NOT NULL DEFAULT '', PRIMARY KEY (`city_id`) ) COLLATE='utf8_general_ci' ENGINE=MyISAM; CREATE TABLE `cities_loc` ( `city_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL DEFAULT NULL, `name_ro` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`city_id`) ) COLLATE='utf8_general_ci' ENGINE=MyISAM; There are data in the tables. I make such a request:
SELECT * FROM cities c JOIN cities_loc cl ON c.city_id = cl.city_id EXPLAIN this query shows that the index does not apply, in POSSIBLE KEYS PRIMARY , and in fact KEY is empty, and rows = 327 .
Why don't indexes work in this case?
