Chris,

The good news is that MySQL 5.0 can finally use multiple indexes per
table.  I just noticed this page in the manual a few days ago:
http://www.mysql.com/doc/en/OR_optimizations.html

:-)


Matt


----- Original Message -----
From: "Chris Nolan"
Sent: Monday, February 16, 2004 7:13 AM
Subject: Re: Indexed searching with OR ?


> Hi!
>
> MySQL's optimizer has a slight problem. OR queries cause it to get
very
> confused.
>
> Try the following to get the best performance:
>
> Rewrite SELECT FROM table WHERE (condition1) OR (condition2);
>
> As:
>
> (SELECT FROM table WHERE condition1) UNION (SELECT FROM table WHERE
> condition2);
>
> Hope this helps!
>
> Regards,
>
> Chris
>
> On Tue, 2004-02-17 at 00:05, Andreas Pardeike wrote:
> > Hi List,
> >
> > Can someone explain the results below? It seems that MySQL has a
hard
> > time choosing keys for 'or' searches. The example here is very
simple
> > but reflects the more complex cases where lots of rows or joins are
> > used perfectly:
> >
<snip>
> >
> > What's the point of indices if I cannot combine two indexed fields
with
> > OR ?
> >
> > Any help appreciated,
> > Andreas Pardeike



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to