Re: Best way to use indexes for partial match at beginning - Mailing list pgsql-general

From Richard Huxton
Subject Re: Best way to use indexes for partial match at beginning
Date
Msg-id 437251A3.9000707@archonet.com
Whole thread Raw
In response to Re: Best way to use indexes for partial match at beginning  ("Andrus" <eetasoft@online.ee>)
List pgsql-general
Andrus wrote:
> So
>
> CREATE INDEX i1 ON foo(col1);
>
> cannot be used to optimize queries of type "get all rows where first n
> charaters of col1 are known" in Postgres.

Of course it will! Any btree based index will let you do that. Re-read
the previous answers and make sure you pay attention to the bit about
text_pattern_ops and LIKE in non-C locales.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: "Markus Wollny"
Date:
Subject: invalid UTF-8 byte sequence detected
Next
From: Jaime Casanova
Date:
Subject: Re: Best way to use indexes for partial match at beginning