List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:April 19 2002 1:38pm
Subject:Re[2]: SELECT the first letter MATCH in mySQL
View as plain text  
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.)

Thread
SELECT the first letter MATCH in mySQLSon Nguyen19 Apr
  • Re: SELECT the first letter MATCH in mySQLJan Peuker19 Apr
    • Re: SELECT the first letter MATCH in mySQLPaul DuBois19 Apr
  • Re: SELECT the first letter MATCH in mySQLCharles Brisson19 Apr
RE: SELECT the first letter MATCH in mySQLMikael Hultén19 Apr
  • Re[2]: SELECT the first letter MATCH in mySQLToomas Vendelin19 Apr
Re[2]: SELECT the first letter MATCH in mySQLToomas Vendelin19 Apr
  • Re[2]: SELECT the first letter MATCH in mySQLPaul DuBois19 Apr