pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fweimer@bfk.de>
To: pgsql-sql@postgresql.org
Subject: Index on elements of an array
Date: Wed, 16 Apr 2008 10:49:59 +0200
Message-ID: <82mynub2vc.fsf@mid.bfk.de> (raw)

Is it possible to create an index on the elements of an array, or a
functional index on a set-returning function?

The index only needs to speed up queries for specific elements (using
a simple membership test, position in the array does not matter) and
perhaps range queries.  The indexed types include integers and text
strings, and possibly more (IP addresses, for instance).  The number
of elements per indexed array rarely exceeds 4, I think.

I fear that the distribution of values makes the intarray module and
full text search inappropriate choices (lots of values unique to a
specific row).

-- 
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99



Message-ID: <82mynub2vc.fsf@mid.bfk.de>
Permalink:  ../82mynub2vc.fsf@mid.bfk.de/
Also on:    postgresql.org/message-id/82mynub2vc.fsf@mid.bfk.de

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: fweimer@bfk.de
  Subject: Re: Index on elements of an array
  In-Reply-To: <82mynub2vc.fsf@mid.bfk.de>

* 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