Re: trouble understanding why query is not using the index.

2005-09-08 Thread Gleb Paharenko
Hello. In my opinion - yes it is, however, trust only the benchmarks :) Jason Pyeron <[EMAIL PROTECTED]> wrote: > > Am I correct in the statment second query is faster? This query gets > executed several million times. > > mysql> explain select A.* from files as A where A.pathre

Re: trouble understanding why query is not using the index.

2005-09-07 Thread Jason Pyeron
Am I correct in the statment second query is faster? This query gets executed several million times. mysql> explain select A.* from files as A where A.pathref=129286 and version=(select max(version) from files as B where A.pathref=B.pathref); +++---+--+

Re: trouble understanding why query is not using the index.

2005-09-07 Thread Gleb Paharenko
Hello. >>> so why does 'explain select * from files where >>> (pathref,version)=(129286,0);' scan the whole table? It is documented that this syntax can't be optimized yet. See: http://dev.mysql.com/doc/mysql/en/row-subqueries.html Jason Pyeron <[EMAIL PROTECTED]> wrote: > On Tu

Re: trouble understanding why query is not using the index.

2005-09-06 Thread Jason Pyeron
On Tue, 6 Sep 2005, Dan Nelson wrote: 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 se

Re: trouble understanding why query is not using the index.

2005-09-06 Thread Dan Nelson
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 c

trouble understanding why query is not using the index.

2005-09-06 Thread Jason Pyeron
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 can rewrite the query, but for reasons out of my control I have to design a query which takes single value for a pat