On Tue, May 20, 2008 at 7:05 AM, Wakan <[EMAIL PROTECTED]> wrote: > can someone could explain where are problems in this query: > > EXPLAIN > SELECT ID > FROM ven_tes > WHERE ID IN (SELECT ID FROM ven_tes WHERE ID_ven=6573)
If that subselect only returns a single result, try using = instead of IN. MySQL performed very poorly on OR queries before version 5. It would avoid using indexes. The new index merge stuff in version 5 fixed that. Also, this query is probably better written as a JOIN. - Perrin -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]