Re: range_agg

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: range_agg
Дата
Msg-id CAFj8pRA6YZ-ueSq7Qq9JU-wNfiG3tfG=6wbpCd00U4O9ugXS-w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: range_agg  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: range_agg  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers


út 9. 7. 2019 v 20:25 odesílatel Jeff Davis <pgsql@j-davis.com> napsal:
On Tue, 2019-07-09 at 07:08 +0200, Pavel Stehule wrote:
>
> I am not against a multirange type, but I miss a explanation why you
> introduce new kind of types and don't use just array of ranges.
>
> Introduction of new kind of types is not like introduction new type.

The biggest benefit, in my opinion, is that it means you can define
functions/operators that take an "anyrange" and return an
"anymultirange". That way you don't have to define different functions
for int4 ranges, date ranges, etc.


I am not sure how strong is this argument.

I think so introduction of anyrangearray polymorphic type and enhancing some type deduction can do same work.

It starts to get even more complex when you want to add opclasses, etc.

Ranges and arrays are effectively generic types that need a type
parameter to become a concrete type. Ideally, we'd have first-class
support for generic types, but I think that's a different topic ;-)

I afraid so with generic multiragetype there lot of array infrastructure will be duplicated

Regards

Pavel


Regards,
        Jeff Davis


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

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: range_agg
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Broken defenses against dropping a partitioning column