Thanks for your reply very much. What I always use is the first way. But I also want to know if the following way is proper when I search "item_id AND item_count" and the column 'item_count'.? ix_item_id (item_id) ix_item_count (item_count)
2008/5/21 Paul McCullagh <[EMAIL PROTECTED]>: > > On May 21, 2008, at 8:09 AM, Moon's Father wrote: > > Now I want to know which way you use to create index of a table. >> 1、ix_u (item_id,item_count) >> ix_item_count (item_count) >> > > This makes sense if you have queries which search "item_id AND item_count", > and queries which just search the column 'item_count'. > > 2、ix_u (item_id,item_count) >> ix_item_id (item_id) >> > > This is duplication of the indexing of the column 'item_id'. The server is > able to use the index ix_u (item_id,item_count) to search on the column > 'item_id'. > > > > >> >> Any reply is welcome. >> Thanks. >> -- >> I'm a mysql DBA in china. >> More about me just visit here: >> http://yueliangdao0608.cublog.cn >> > > -- I'm a mysql DBA in china. More about me just visit here: http://yueliangdao0608.cublog.cn