From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Marc Mitchell <marcm@eisolution.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: LIKE operator and indexes
Date: Fri, 31 May 2002 10:02:17 -0700 (PDT)
Message-ID: <20020531095711.V56129-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <01f301c208c0$a9b74ae0$7501050a@eisolution.com>
On Fri, 31 May 2002, Marc Mitchell wrote:
> Can anyone provide definitive information and/or points of reference within
> the documentation about the ability of the query optimizer to use indexes
> when processing a "LIKE" operator on a String column?
>
> My assumption is that
>
> "SELECT * FROM customer WHERE name LIKE 'GENERAL%';"
>
> should benefit from the existence of a BTREE index on the "customer.name"
> column. I know this is the case is most other RDBMS's I've used including
> Postgres's ancestor Ingres.
If you are in "C" locale, and have an anchored like or regex, indexes
should be considered. If you're in a different locale, the optimization
is turned off.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, marcm@eisolution.com
Subject: Re: LIKE operator and indexes
In-Reply-To: <20020531095711.V56129-100000@megazone23.bigpanda.com>
References: <01f301c208c0$a9b74ae0$7501050a@eisolution.com> <20020531095711.V56129-100000@megazone23.bigpanda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox