Re: range_agg

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема Re: range_agg
Дата
Msg-id CADkLM=dP8f8T0oDxOsYWDacZO9ydj3o5xgr7aTvhZgQWonm3Bw@mail.gmail.com
обсуждение исходный текст
Ответ на range_agg  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Ответы Re: range_agg  (Paul Jungwirth <pj@illuminatedcomputing.com>)
Список pgsql-hackers
One question is how to aggregate ranges that would leave gaps and/or
overlaps. So in my extension there is a one-param version that forbids
gaps & overlaps, but I let you permit them by passing extra parameters,
so the signature is:

Perhaps a third way would be to allow and preserve the gaps.

A while back I wrote an extension called disjoint_date_range for storing sets of dates where it was assumed that most dates would be contiguous. The basic idea was that The core datatype was an array of ranges of dates, and with every modification you'd unnest them all to their discrete elements and use a window function to identify "runs" of dates and recompose them into a canonical set. It was an efficient way of representing "Every day last year except for June 2nd and August 4th, when we closed business for special events."

For arrays of ranges the principle is the same but it'd get a bit more tricky, you'd have to order by low bound, use window functions to detect adjacency/overlap to identify your runs, and the generate the canonical minimum set of ranges in your array.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Commits 8de72b and 5457a1 (COPY FREEZE)
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: VACUUM can finish an interrupted nbtree page split -- is that okay?