Re: Indexing an array?

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Silke Trissl <trissl(at)informatik(dot)hu-berlin(dot)de>
Subject: Re: Indexing an array?
Date: 2005-09-09 23:35:30
Message-ID: 43221C42.2060605@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Hoeller 2005-09-10 15:45:50 how to have 2 select creteria on one column?
Previous Message Mark A. Strivens 2005-09-09 16:04:44 Age in days