Re: Array comparison & prefix search - Mailing list pgsql-general

From Sam Mason
Subject Re: Array comparison & prefix search
Date
Msg-id 20091207120144.GN5407@samason.me.uk
Whole thread Raw
In response to Re: Array comparison & prefix search  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: Array comparison & prefix search  (Merlin Moncure <mmoncure@gmail.com>)
Re: Array comparison & prefix search  (Denes Daniel <panther-d@freemail.hu>)
List pgsql-general
On Sat, Dec 05, 2009 at 09:54:58AM -0500, Merlin Moncure wrote:
> GIN is a pretty heavy price to pay for something that should be btree
> indexable.  Also note he is using a multi column index with array as
> second column...that would be pretty awkward with GIN.

Yup, sounds as though it's not going to work here.  I was mainly
suggesting it as it's working now, as opposed to something that
could/should be made to work.

> Normalizing the data loses the nice property of being able to order
> the entire structure using a single index.  He's using the array as if
> it was a string...it's basically an optimization.

Hum, not sure why this didn't come up already: what about having an
index on (type,(array_to_string(ident,'##')) and relying on the already
existing optimizations for string prefixes.  Not sure what sort of
values can be used in "ident", but it could work.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: [HACKERS] Installing PL/pgSQL by default
Next
From: Sam Mason
Date:
Subject: Re: What packages I need to install to get Postgres working