> > MySQL doesn't seem to be very smart about queries involving OR and
> > things like <>. For me creating temporary tables or writing perl
> > scripts to do the job solved my particular problems. But I am working
> > with tables that don't change but have some 100,000,000 rows...
> >
> > I guess I suggest, introducing some redundancy and removing the OR
> > statement could help in your case...
> >


You are right, I see it now..    the OR clause combining 2 distinct
attribute clauses is killing you..  as the terms are different, no 1
index can simplify both directions so you wind up scanning the table
in every case:

I have had good luck breaking things like that up into 2 separate
queries and then UNIONing them together...  each branch of the UNION
can plan it's own strategy.


-- 
 - michael dykman
 - [EMAIL PROTECTED]

 - All models are wrong.  Some models are useful.

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

Reply via email to