Re: Indexes on Arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kristofer Munn <kmunn(at)munn(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Indexes on Arrays
Date: 2000-09-06 05:02:06
Message-ID: 12616.968216526@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kristofer Munn <kmunn(at)munn(dot)com> writes:
> I have a table with an array like so:
> create table foo (
> id int4,
> names varchar(80)[]
> );
> and would like to place an index on name[1].

Right now the only way is to make a function that extracts names[1]
and create a functional index on yourfunction(names).

Although functional indexes are a perfectly good general solution from
an academic point of view, this is still a pain in the neck :-(.
Also kinda slow, unless you code the function in C.

I recall talking to someone who was going to look at supporting more
general expressions for index values, but nothing's come of the idea
so far.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-09-06 05:18:38 Re: The next release
Previous Message The Hermit Hacker 2000-09-06 04:16:50 Re: The next release