News for hackers. Stuff that matters.
Re:Multiranges in Postgres by timwis on Thursday October 27, 2022 @03:13AM (#33354245)
Wow, I was just trying to solve the problem of merging overlapping periods in ruby. Life would be so much easier if the database did it for me!
Re:Multiranges in Postgres by philz99 on Thursday October 27, 2022 @03:53AM (#33354519)
wow
Re:Multiranges in Postgres by philz99 on Thursday October 27, 2022 @03:54AM (#33354528)
oh
[dead]
Re:Multiranges in Postgres by RedShift1 on Thursday October 27, 2022 @04:37AM (#33354852)
Test failed
Re:Multiranges in Postgres by skrebbel on Thursday October 27, 2022 @04:17AM (#33354699)
It works!
Re:Multiranges in Postgres by awild on Thursday October 27, 2022 @05:36AM (#33355267)
Sort by lowest start, merge left when they overlap. Emit current span if not. Repeat.
Re:Multiranges in Postgres by badelectron on Saturday October 29, 2022 @07:04AM (#33382939)
If you want to do this with a data structure instead of a database then discrete interval encoding trees solve this problem well. https://xlinux.nist.gov/dads/HTML/discretintrv.html