Re: Indexing varchar[]'s

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Indexing varchar[]'s
Date: 2001-06-16 04:13:56
Message-ID: 20010615231356.E12269@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jun 15, 2001 at 10:46:00AM -0400, Tom Lane wrote:
> "Eric Ridge" <ebr(at)tcdi(dot)com> writes:
> > If this has been asked and answered before, I am sorry. I've been
> > digging through the mail archives and cannot find this particular
> > question (although some releated to int64[]'s). Is it possible, with
> > 7.1.2, to create an index on a varchar[]?
>
> No, there's no support for indexes on varchar arrays (or any other kind
> of array). What sorts of things do you think such an index should be
> able to do?

i'd bet that it's likely that something could be done with a
subsidiary relation -- instead of

create table burgeoning (
id serial,
stuff text,
amt float8,
xref int8,
xyz varchar[], -- hmm?
primary key (id)
);

maybe this would be a good alternative:

create table streamline (
id serial,
stuff text,
amt float8,
xref int8,
primary key (id)
);
create table subsidiary (
id references streamline(id),
xyz varchar -- aha!
);
create view shebang as
select
streamline.*,
subsidiary.xyz
from
streamline,
subsidiary
where
streamline.id = subsidiary.id
;

may not work in some cases, but it's certainly easier on the
indexing, yes?

--
I figure: if a man's gonna gamble, may as well do it
without plowing. -- Bama Dillert, "Some Came Running"

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-06-16 04:18:26 Re: canned code to get db on web quickly via perl or PHP?
Previous Message will trillich 2001-06-16 04:07:31 Re: OT: Apache::Session::DBI vs postgresql? --help