- 論壇徽章:
- 0
|
有一張正文表,字段有d_id(文檔id),createdate(創(chuàng)建日期),createtime(創(chuàng)建時間),title(標(biāo)題)等- CREATE TABLE `content` (
- `d_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `createdate` date NOT NULL DEFAULT '0000-00-00',
- `createtime` time NOT NULL DEFAULT '00:00:00',
- `title` text,
- ……
- PRIMARY KEY (`d_id`),
- KEY `createdate` (`createdate`,`createtime`),
- ) ENGINE=MyISAM
復(fù)制代碼 執(zhí)行以下sql- select * from content where title like '出版%' and createdate = '2011-11-29' order by d_id desc limit 1 ;
復(fù)制代碼 慢日志:
# Query_time: 17.311505 Lock_time: 0.000670 Rows_sent: 0 Rows_examined: 1972413
為什么Rows_examined是1972413這么大?符合createdate = '2011-11-29'條件的記錄僅有3000多條阿?
是索引建的有問題么?
是不應(yīng)該做createdate和createtime的聯(lián)合索引么?
實在是不解。求高人指點! |
|