MySQL Forums
Forum List  »  Performance

how to force partial column index in where clause?
Posted by: Daniel Szabo
Date: June 07, 2005 07:14AM

Assume a column

`memo` varchar(100) binary NOT NULL

and a partial index on that column

key memo (`memo` (1))

How to force mysql to use only index data for evalutaing the where clause?

this will read the mathing range of records (based on the index) and evaluate 'A%' on all of them:

select count(*) from m where memo like 'A%';

this one will even read all records in the table:

select count(*) from m where left(memo,1)='A';

Is the only option to convert the partial index to a full index?

Options: ReplyQuote


Subject
Views
Written By
Posted
how to force partial column index in where clause?
2055
June 07, 2005 07:14AM


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.