Re: Using index for substring search - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Using index for substring search
Date
Msg-id 200203130010.g2D0AgY23142@candle.pha.pa.us
Whole thread Raw
In response to Using index for substring search  (Lec <englim@pc.jaring.my>)
List pgsql-general
Lec wrote:
> Is it possible for postgreSQL 7.2 to use index search for the following
> queries:
>
> select name from item where substring(itemcode,1,3) = '101';
> select name from item where itemcode like '101%';
>
> if I have an index on itemcode.
>
> Version 6.5.3 can use index search for the first query.

Are you sure?  7.2 and I thought earlier releases could only use an
index on the second query.  There is even an FAQ item.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: hubert.palme@web.de (Hubert Palme)
Date:
Subject: Re: PL/pgSQL Syntax Problem
Next
From: David Fetter
Date:
Subject: Storing Credit Card Info?