From: Dan Nelson Date: September 6 2005 10:56pm Subject: Re: trouble understanding why query is not using the index. List-Archive: http://lists.mysql.com/mysql/188786 Message-Id: <20050906225613.GG43293@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Sep 06), Jason Pyeron said: > there is an unique key index 'pathref_2 (pathref,version)' on this > table. > > so why does 'explain select * from files where > (pathref,version)=(129286,0);' scan the whole table? I have to admit I have never seen this syntax used in a where clause before. Does "where pathref=129286 and version=0" optimize any better? A quick test of mysql-5.0.11 indicates that it doesn't use indexes at all with the (field1,field2,..)=(value1,value2,..) syntax. Feel free to file a bug :) -- Dan Nelson dnelson@stripped