Re: range_agg

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: range_agg
Дата
Msg-id CAKFQuwbc9eHwuU3vmdCWuhCtdVzPvOaivzYk7xi4HsYsrGXgrQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: range_agg  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Fri, Dec 20, 2019 at 10:43 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
I took the liberty of rebasing this series on top of recent branch
master.

In the tests there is:

+select '{[a,a],[b,b]}'::textmultirange;
+ textmultirange
+----------------
+ {[a,a],[b,b]}
+(1 row)
+
+-- without canonicalization, we can't join these:
+select '{[a,a], [b,b]}'::textmultirange;
+ textmultirange
+----------------
+ {[a,a],[b,b]}
+(1 row)
+

Aside from the comment they are identical so I'm confused as to why both tests exist - though I suspect it has to do with the fact that the expected result would be {[a,b]} since text is discrete.

Also, the current patch set seems a bit undecided on whether it wants to be truly a multi-range or a range that can report non-contiguous components.  Specifically,

+select '{[a,d), [b,f]}'::textmultirange;
+ textmultirange
+----------------
+ {[a,f]}
+(1 row)

There is a an argument that a multi-range should output {[a,d),[b,f]}.  IMO its arguable that a multi-range container should not try and reduce the number of contained ranges at all.  If that is indeed a desire, which seems like it is, that feature alone goes a long way to support wanting to just merge the desired functionality into the existing range type, where the final output has the minimum number of contiguous ranges possible, rather than having a separate multirange type.

David J.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: range_agg
Следующее
От: Justin Pryzby
Дата:
Сообщение: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction