pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron Mayer <rm_pg@cheapcomplexdevices.com>
To: Silke Trissl <trissl@informatik.hu-berlin.de>
Subject: Re: Indexing an array?
Date: Fri, 09 Sep 2005 16:35:30 -0700
Message-ID: <43221C42.2060605@cheapcomplexdevices.com> (raw)
In-Reply-To: <43206338.9020502@informatik.hu-berlin.de>
References: <43206338.9020502@informatik.hu-berlin.de>

Silke Trissl wrote:
> As far I could read from the documentation - this should be possible.
> But my question is, is there a kind of index on the array.

If your needs are a bit more modest (say, a few thousands instead of 
billions) the stuff in contrib/intarray works well; and if you
needed types other than integers you can you can look at intarray
to see how to build indexes on them and what those indexes
are useful for.

> Lets say, I want to get element 2,675,345,328. Does Postgres have to
> load the entire array into memory and then run through the 2.6 billion
> characters to return the one I want or does Postgres have an index - as
> where to find this element on disk?

Wouldn't you rather expect an index to be useful for finding which
rows match your query rather than for finding content within a row?



view thread (5+ messages)

Message-ID: <43221C42.2060605@cheapcomplexdevices.com>
Permalink:  ../43221C42.2060605@cheapcomplexdevices.com/
Also on:    postgresql.org/message-id/43221C42.2060605@cheapcomplexdevices.com

 · 

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: rm_pg@cheapcomplexdevices.com, trissl@informatik.hu-berlin.de
  Subject: Re: Indexing an array?
  In-Reply-To: <43221C42.2060605@cheapcomplexdevices.com>

* 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