At 18:07 -0800 2/10/02, Jeremy Zawodny wrote:
>On Sun, Feb 10, 2002 at 02:53:53PM -0500, Matthew Dougherty wrote:
>>  If I use a REGEXP query on an indexed column using something like:
>>  Field REGEXP '^A|^B|^C'
>>
>>  Will MySQL use the index like it would if I used Field LIKE 'A%' or
>>  Field LIKE 'B%' or FIeld LIKE 'C%' ??
>
>It will not.
>
>Regular expressions are best used when you need something more complex
>than what "%" allows you to achieve.

Not to mention that an index won't be used even for the LIKE expression,
because it uses OR.  At least, I think it won't be.

>Jeremy
>--
>Jeremy D. Zawodny, <[EMAIL PROTECTED]>
>Technical Yahoo - Yahoo Finance
>Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936
>
>MySQL 3.23.47-max: up 3 days, processed 121,771,991 queries (403/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to