pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Gist indexes on int arrays
Date: 03 Mar 2003 16:29:18 -0500
Message-ID: <87wujgi1g1.fsf@stark.dyndns.tv> (raw)


> What do you mean??
> GiST indexing just indexes columns of type *array* for the &&,=,@,~,@@,
> etc.. operators.

Hm, you're right of course. I wonder where I got the idea that it didn't
handle these operators.

This is fascinating and could be useful for something I'm working on. 

How do gist indexes interact with more normal data types to index? I have a
situation where I have a table with millions of records, and I'm mostly
operating on a subset of those records, usually 1k-10k of them. 

The queries would look like

WHERE foo_id = ?
  AND '{1}'::integer[] ~ attr_a
  AND '{2}'::integer[] ~ attr_b

Right now I'm using the contrib/array *= operator and I have an index on
foo_id. Having to scan through up to 10,000 records isn't great but isn't too
bad. I wonder whether having a gist index and using the ~ operator would be
worthwhile?

The contrib/array, contrib/intagg, and contrib/intarray directories seem to
all be aimed at handling the same thing and seem to provide mostly
complementary features. Perhaps they should all be merged into one package. I
guess it does show there's lots of demand for this type of datatype.

--
greg




view thread (11+ messages)  latest in thread

Message-ID: <87wujgi1g1.fsf@stark.dyndns.tv>
Permalink:  ../87wujgi1g1.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/87wujgi1g1.fsf@stark.dyndns.tv

 · 

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: gsstark@mit.edu
  Subject: Re: Gist indexes on int arrays
  In-Reply-To: <87wujgi1g1.fsf@stark.dyndns.tv>

* 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