Re: Re: LIKE and indexes?

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "adb" <adb(at)Beast(dot)COM>, "Alexander Jerusalem" <alexander(dot)jerusalem(at)pop(dot)chello(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: LIKE and indexes?
Date: 2001-03-15 13:33:56
Message-ID: 200103151333.f2FDXvG29294@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Elphick(at)lfix(dot)co(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2001-03-15 13:35:56 Re: Re: Prompt question
Previous Message Daniel A. Melo 2001-03-15 13:21:49 Initdb error