Re: composite type array and index

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: composite type array and index
Дата
Msg-id b42b73150705240725i2d16b975ob33769e8d03bcd46@mail.gmail.com
обсуждение исходный текст
Ответ на composite type array and index  (Marek Lewczuk <newsy@lewczuk.com>)
Список pgsql-general
On 5/24/07, Marek Lewczuk <newsy@lewczuk.com> wrote:
> Hello everyone,
> it's great to have in next release (8.3) great feature: composite type
> array. I'm waiting to see how it works, however I wonder whether it will
> be possible to create an index on a column of composite type array just
> like we have an index on integer[] column (using gin or intarray module) ?

good question.   one small point here.  you can index int[] with
standard btree and not gist which optimizes equality searches, etc.
The problem is not the array but that composite types have no defined
comparison function.

You can create an index on table with composite array type but it's
not really any use because the operator class is not defined for the
type.  Array orderings decompose to orderings on the internal type.
If you really need the functionality you can create an operator class
for btree (for simple operations) or gist (for more complex searches
inside the array), gin, etc.

I guess it would be kinda nice if composite types had a 'operator of
last resort' which would work as the sql-row comparison does, and do
ordering left to right for purposes of comparison.

merlin

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

Предыдущее
От: "btober"
Дата:
Сообщение: Re: Geographic data sources, queries and questions
Следующее
От: Célestin HELLEU
Дата:
Сообщение: Very big transaction in a stored procedure : how can i commit in the middle of it ?