News for hackers. Stuff that matters.
Re:Distinct on: a confusing, unique and useful feature in Po... by claytonjy on Friday March 20, 2020 @03:23PM (#22640708)
I've been using Timescale DB, a postgres extension, to store our sensor-produced timeseries data and it handles this pretty well. DISTINCT ON seems to ruin the query plan there, by forcing sequential, non-index scans of each subtable (timescale breaks tables into time-buckets behind the scenes, so it can skip searching tables in time-filtered queries). I've had good performance with their "time_bucket" and "last" functions, though, and not having to use some NoSQL time series database has been really nice.

There are no comments on this comment yet.