5.0.0 has a new method to use both of your indexes in an OR query like this and merge the results. See "How MySQL Optimizes OR Clauses" <http://www.mysql.com/doc/en/OR_optimizations.html> for the details.
Michael
A Z wrote:
Thanks, but this is not what we expected. This means to change the SQL command in the application. Our understanding from the manual and other relational DBs is that, it's suffice for existence of an index on the field in the criteria (where clause) to run at optimal speed.
regards
--- Harald Fuchs <[EMAIL PROTECTED]> wrote:
A Z <[EMAIL PROTECTED]> writes:
The problem (very slow) occurs when the query is run on combination of these fields: Select * from table1 where (Field1Idx Like
'Value%' or
Field2Idx Like 'Value%')
Try a UNION query:
SELECT * FROM table1 WHERE Field1Idx LIKE 'Value%' UNION SELECT * FROM table1 WHERE Field2Idx LIKE 'Value%'
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]