DROP TABLE IF EXISTS diaries;
SET NAMES utf8;
CREATE TABLE diaries (
id int PRIMARY KEY,
title varchar(255),
created_at datetime,
KEY created_at_index (created_at)
) DEFAULT CHARSET=utf8;
ALTER TABLE diaries DISABLE KEYS;
INSERT INTO diaries VALUES (1, "Hello", "2012-04-30 20:00:00");
INSERT INTO diaries VALUES (2, "天気" , "2012-04-30 23:00:00");
INSERT INTO diaries VALUES (3, "富士山", "2012-04-30 19:00:00");
SELECT *
FROM diaries
FORCE INDEX (created_at_index)
WHERE created_at = "2012-04-30 20:00:00";
id	title	created_at
1	Hello	2012-04-30 20:00:00
ALTER TABLE diaries ENABLE KEYS;
SELECT *
FROM diaries
FORCE INDEX (created_at_index)
WHERE created_at = "2012-04-30 20:00:00";
id	title	created_at
1	Hello	2012-04-30 20:00:00
DROP TABLE diaries;
