Multiranges in Postgres
cybertec-postgresql.com
Multiranges in Postgres
1–10 of 34 posts
Re: Multiranges in Postgres
#2Wow, 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
#3Wow, 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!
No post body was provided.
Re: Multiranges in Postgres
#4Re: Multiranges in Postgres
#5Re: Multiranges in Postgres
#6Re: Multiranges in Postgres
#7It’s also worth knowing that you can accelerate many sorts of range queries with a GIST index. This often ends up faster than using two separate columns.
Re: Multiranges in Postgres
#8Re: Multiranges in Postgres
#9I really like PostgreSQL ranges, but I've always been curious, if these are an extension or they are a part of the SQL standard? The “Range Types” page[1] doesn't seem to mention the standard at all, and appendix D.1, “Supported Features”, doesn't mention range types.
The reason I'm curious is because may future SQL database implementations will most likely use the standard at least in some capacity, so it'd be nice to know, how future-proof and DBMS-switch-proof a schema using these could be.
[1]: https://www.postgresql.org/docs/current/rangetypes.html
[2]: https://www.postgresql.org/docs/current/features-sql-standar...
Re: Multiranges in Postgres
#10Wow, 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!
Sort by lowest start, merge left when they overlap. Emit current span if not. Repeat.