In the last episode (Apr 24), Fan, Wellington said: > Thanks; I was really trying to ask about the potential performance > gain, however. I don't care so much about the UNIQUEness, but the > INDEXness. > > See, I am wondering if I create an 2-column index wiht fk1 as the > first component, will that index help me if I am refering fk2 in my > query?
You mean like "SELECT fk2 FROM t WHERE fk1 IN (1,2,3,4)"? Yes. You can verify this by looking at the EXPLAIN plan for the query. If it says "Using index" in the Extra column, it means all the fields mysql needs is in the index and it won't have to fetch row data. -- Dan Nelson [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]