Re: Re: LIKE and indexes? - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Re: LIKE and indexes?
Date
Msg-id 200103151333.f2FDXvG29294@linda.lfix.co.uk
Whole thread Raw
In response to Re: Re: LIKE and indexes?  ("Richard Huxton" <dev@archonet.com>)
List pgsql-general
"Richard Huxton" wrote:
  >> I've done an EXPLAIN and I saw that no index was used although my SQL
  >> statement had a wild card only at the end as you pointed out ('blah%'). My
  >> guess is that this is because of the locale support.
  >
  >Try like '^blah%' - maybe the additional hint will help (but maybe not). How
  >many rows did PG think it was going to access in the explain?

No, Richard, you can't mix regular expressions with SQL LIKE.  For LIKE, '^'
is an ordinary character to match.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Blessed are the poor in spirit, for theirs is the
      kingdom of heaven...Blessed are they which do hunger
      and thirst after righteousness, for they shall be
      filled...Blessed are the pure in heart, for they shall
      see God."                   Matthew 5:3,6,8



pgsql-general by date:

Previous
From: "Daniel A. Melo"
Date:
Subject: Initdb error
Next
From: "Oliver Elphick"
Date:
Subject: Re: Re: Prompt question