MySQL Forums
Forum List  »  Optimizer & Parser

no optimization?
Posted by: Uwe
Date: May 22, 2006 05:47AM

Hello

Since MySQL 4.1 it's possible (but undocumented?) to use a syntax like:

SELECT * FROM tbl WHERE (field1, field2) = (val1, val2)
SELECT * FROM tbl WHERE (field1, field2) IN ((val1, val2), (val3, val4), ...)

Unfortunately this type of query results in a full table scan in both MySQL 4.1 and 5.0 even if field1 or field1+field2 are keys. Force Index (field1) doesn't work either.

Is this a bug or is it just an unofficial feature not built into the optimizer yet?


Uwe

Options: ReplyQuote


Subject
Views
Written By
Posted
no optimization?
2508
Uwe
May 22, 2006 05:47AM
1853
June 18, 2006 08:50PM
1819
Uwe
June 21, 2006 10:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.