Re: Composite types or composite keys?

Поиск
Список
Период
Сортировка
От Tony Theodore
Тема Re: Composite types or composite keys?
Дата
Msg-id 56EBD949-93BD-4152-95FA-8C5BB22319E1@gmail.com
обсуждение исходный текст
Ответ на Re: Composite types or composite keys?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
On 16 Nov 2013, at 3:01 am, Merlin Moncure <mmoncure@gmail.com> wrote:
>
> Well, here are the downsides.  Composite types:
> *) are more than the sum of their parts performance-wise.  So there is
> a storage penalty in both the heap and the index
> *) can't leverage indexes that are querying only part of the key
> *) will defeat the implicit 'per column NOT NULL constraint' of the primary keys

Thanks, I didn’t see any of those - I was thinking that they were like pseudo tables or column templates.

> *) are not very well supported in certain clients -- for example JAVA.
> you can always deal with them as text, but that can be a headache.
>
> ...plus some other things I didn't think about.  If you can deal with
> those constraints, it might be interesting to try a limited
> experiment.   The big upside of composite types is that you can add
> attributes on the fly without rebuilding the index.  Test carefully.

I’ll give it a try - I might stick to using plain or inherited tables for the main storage and then experiment with
compositetypes for functions and other aggregate tables that are used internally. 

Cheers,

Tony



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

Предыдущее
От: Hengky Liwandouw
Дата:
Сообщение: Sum 2 tables based on key from other table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: What does this error message mean?