Re: range_agg - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: range_agg
Date
Msg-id ba323e489b98029be5ba2d5c5cbc99795f333f48.camel@j-davis.com
Whole thread Raw
In response to range_agg  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Responses Re: range_agg  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: range_agg  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Re: range_agg  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
On Fri, 2019-05-03 at 15:56 -0700, Paul Jungwirth wrote:
> Hello,
> 
> I wrote an extension to add a range_agg function with similar
> behavior 
> to existing *_agg functions, and I'm wondering if folks would like
> to 
> have it in core? Here is the repo: 
> https://github.com/pjungwir/range_agg

This seems like a very useful extension, thank you.

For getting into core though, it should be a more complete set of
related operations. The patch is implicitly introducing the concept of
a "multirange" (in this case, an array of ranges), but it's not making
the concept whole.

What else should return a multirange? This patch implements the union-
agg of ranges, but we also might want an intersection-agg of ranges
(that is, the set of ranges that are subranges of every input). Given
that there are other options here, the name "range_agg" is too generic
to mean union-agg specifically.

What can we do with a multirange? A lot of range operators still make
sense, like "contains" or "overlaps"; but "adjacent" doesn't quite
work. What about new operations like inverting a multirange to get the
gaps?

Do we want to continue with the array-of-ranges implementation of a
multirange, or do we want a first-class multirange concept that might
eliminate the boilerplate around defining all of these operations?

If we have a more complete set of operators here, the flags for
handling overlapping ranges and gaps will be unnecessary.

Regards,
    Jeff Davis





pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Add parallelism and glibc dependent only options to reindexdb
Next
From: Peter Eisentraut
Date:
Subject: Re: Are there still non-ELF BSD systems?