Re: How to make LIKE to use index in "abc%" query? - Mailing list pgsql-general

From Dimitri Fontaine
Subject Re: How to make LIKE to use index in "abc%" query?
Date
Msg-id 200710081852.19057.dfontaine@hi-media.com
Whole thread Raw
In response to How to make LIKE to use index in "abc%" query?  ("Dmitry Koterov" <dmitry@koterov.ru>)
List pgsql-general
Le lundi 08 octobre 2007, Dmitry Koterov a écrit :
> explain analyze
> SELECT id FROM "table" WHERE name LIKE 'dt%';
>
> having a btree index on "name" column. But unfortunately it uses seqscan
> instead of index scan, it's too slow.

It seems to me you'd benefit from reading this page of the fine manual:
  http://www.postgresql.org/docs/current/interactive/indexes-opclass.html

Regards,
--
dim

Attachment

pgsql-general by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: How to make LIKE to use index in "abc%" query?
Next
From: "Bill Bartlett"
Date:
Subject: Re: Request: Anyone using bogus / "humorous" X-Message-Flag headers, could we please turn them off