From: "Keith Thompson" <[EMAIL PROTECTED]>

>     select somefields from t1, t2 where t1.id = t2.id and t2.x2 =
somenumber;

Try:
select somefields from t1 join t2 on t1.id = t2.id and t2.x2 = somenumber;

Also take a look at the estimate number of records for each step in the
explain output.
It's often faster to have a low number of records for each step than to have
an optimal join type.

The optimizer in MySQL needs help a lot of times.

I've found that I sometimes need to use IGNORE_INDEX or even FORCE_INDEX to
get MySQL to use the right index.

Regards, Jigal.


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

Reply via email to