Re: Set Operators and Arrays Question

Поиск
Список
Период
Сортировка
От Emmanuel Charpentier
Тема Re: Set Operators and Arrays Question
Дата
Msg-id 3A9ED320.EF03708A@bacbuc.dyndns.org
обсуждение исходный текст
Ответ на Set Operators and Arrays Question  (Geoff Russell <geoff@austrics.com.au>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Kostis Mentzelos
Дата:
Сообщение: SERIAL values
Следующее
От: Chris Humphries
Дата:
Сообщение: pgsql and *nix filesystems combo?!