Re: Indexing varchar[]'s - Mailing list pgsql-general

From will trillich
Subject Re: Indexing varchar[]'s
Date
Msg-id 20010615231356.E12269@serensoft.com
Whole thread Raw
In response to Re: Indexing varchar[]'s  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Jun 15, 2001 at 10:46:00AM -0400, Tom Lane wrote:
> "Eric Ridge" <ebr@tcdi.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@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: will trillich
Date:
Subject: Re: OT: Apache::Session::DBI vs postgresql? --help
Next
From: will trillich
Date:
Subject: Re: canned code to get db on web quickly via perl or PHP?