At 15:29 +0200 4/19/02, Toomas Vendelin wrote:
>Hello Paul,
>
>But RLIKE won't use indexes (even if they exist), so why RLIKE '^A' is
>better than LIKE 'A%', if LIKE which starts at the beginning of the
>string **will** use indexes?

I was comparing RLIKE '^A.*' to RLIKE '^A', not RLIKE to LIKE.

>
>Regards,
>
>Tom
>
>PD> Regular expression patterns (unlike SQL patterns) don't need to match the
>PD> entire string, so RLIKE '^A' is sufficient and more efficient because
>PD> it doesn't spend time trying to match anything other than the first
>PD> character.
>
>PD> As to the original question (below), that query looks like it should
>PD> work.  Perhaps the problem lies elsewhere in the code that executes
>PD> the query.  (It may be the query gets modified somehow.  Without seeing
>PD> the context, it's hard to say.)


---------------------------------------------------------------------
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