SELECT wor_id,Gzxx,Gzsj,daiyu,adddate FROM `ejz_wor` WHERE shenhe=1 and Gzxx like '%暑%' and Adddate between '2010-03-01'and'2010-05-29'SELECT wor_id,Gzxx,Gzsj,daiyu,adddate FROM `ejz_wor` WHERE shenhe=1 and Gzsj like '%暑%' and Adddate between '2010-03-01'and'2010-05-29'MySql 怎么建立合适的索引 ,查询的数据量大! 我试着建立了多列索引 查询反而比没建的索引耗时多 晕了 ,没办法了 数据库方面的专家 看看。
只建复合索引:(shenhe, Adddate)吧, 并把条件Gzxx like以及Gzsj like移到where的末尾。
MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html