Re: Set Operators and Arrays Question

From: Emmanuel Charpentier <charpent(at)bacbuc(dot)dyndns(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Set Operators and Arrays Question
Date: 2001-03-01 22:54:24
Message-ID: 3A9ED320.EF03708A@bacbuc.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Geoff Russell wrote:
>
> Hello readers and writers,
>
> I have a concrete problem which I think is similar to a large class of
> problems. I want to propose a better solution for my concrete problem,
> which, if implemented, would be generally useful. Then again someone
> may come up with a better method again...

[ Bandwidth savings ... ]

> I'm really just suggesting a couple of set operators for arrays.
>
> Perhaps there is already a better way of doing this? I'm open to suggestions.

IMHO, your current siolution is the best, because it doesn't need any
guesstimate, and is in the correct 5th normal form.

I agree that it might eat a bit of disk, but given current prices of
hardware, this should not be a consideration. By golly, a 40 GB disk is
now about $100-200 ... Another nice way to speed up a database system is
to throw RAM at it. Again, RAM is cheap, nowadays ... Wher I live, 128
MB can be got for about $50-100, depending of your source.

Furthermore, your current solution is also the best in the sense that it
will scale well. Not the case for array-based solutions.

IMHO, arrays have a very restricted usefulness : to describe correctly
objects uniquely identified by a fixed number of identical items. E. g.
points, vectors and other *simple* geometrical entities. However, event
that could fail : the descriptioon of a polygon needs an arbitrary
number of points, and thus cannot be easily represented by an array,
whatever its dimensions ...

Your wishlist solution would require implementation of sets (or lists,
which are not the same but sometimes a nice representation of sets) in
Postgres.

There is an awful lot of reasons for which this would be difficult and
probably inefficient. Your current implementation is probably the best
possible in a RDBMS.

Hope this helps,

E. Charpentier

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Metzidis, Anthony 2001-03-01 23:16:57 showing rules/triggers with psql
Previous Message Kostis Mentzelos 2001-03-01 22:53:09 SERIAL values