Re: How to speed up slow query from OR

2002-08-01 Thread Jeremy Zawodny
On Thu, Aug 01, 2002 at 06:15:16PM +0200, Joseph Bueno wrote: > > According to MySQL documentation, indexes are not used with OR: > http://www.mysql.com/doc/M/y/MySQL_indexes.html > You can't speed up your query by adding indexes. > Running 2 separate queries is the best you can do if you want to

Re: How to speed up slow query from OR

2002-08-01 Thread Brent Baisley
If running two queries is running faster than perhaps the best way to do it is select the first query into a temporary table and then insert select the second to append to the temp table. Then you can select and sort however you want from the temporary table. create table tempname SELECT somet

Re: How to speed up slow query from OR

2002-08-01 Thread Joseph Bueno
James MacLean wrote: >On Thu, 1 Aug 2002, Ralf Narozny wrote: > > > >>Hello! >> >>James MacLean wrote: >> >> >> >>>Hi Folks, >>>Have only known enough SQL to do what we needed. >>>Today on mysql-3.23.51 we found out that : >>>select something from table where index1 = 'value' or index2 = '

Re: How to speed up slow query from OR

2002-08-01 Thread James MacLean
On Thu, 1 Aug 2002, Ralf Narozny wrote: > Hello! > > James MacLean wrote: > > >Hi Folks, > >Have only known enough SQL to do what we needed. > >Today on mysql-3.23.51 we found out that : > >select something from table where index1 = 'value' or index2 = 'value'; > >Runs considerably slower than

Re: How to speed up slow query from OR

2002-08-01 Thread Ralf Narozny
Hello! James MacLean wrote: >Hi Folks, > >Have only known enough SQL to do what we needed. > >Today on mysql-3.23.51 we found out that : > >select something from table where index1 = 'value' or index2 = 'value'; > >Runs considerably slower than: > >select something from table where index1 = 'va

How to speed up slow query from OR

2002-07-31 Thread James MacLean
Hi Folks, Have only known enough SQL to do what we needed. Today on mysql-3.23.51 we found out that : select something from table where index1 = 'value' or index2 = 'value'; Runs considerably slower than: select something from table where index1 = 'value'; or select something from table wher