mysql 索引

EXPLAIN SELECT id FROM tuce_case WHERE state=0 AND meitu_adopt=1 AND gz_type=0 ORDER BY priority DESC,id DESC




EXPLAIN SELECT id FROM tuce_case WHERE state=0 AND meitu_adopt AND gz_type>0 ORDER BY priority DESC,id DESC



KEY `priority_gztype` (`priority`,`id`,`state`,`meitu_adopt`,`gz_type`),

建立了这样的索引    优先order by 字段 ,然后where 字段,

你可能感兴趣的:(mysql)