News for hackers. Stuff that matters.
Re:How PostgreSQL aggregation works and how it inspired our ... by throwdbaaway on Friday August 06, 2021 @12:33AM (#28083347)
I don't quite understand how is it possible to rollup percentile_agg from 15 minutes buckets to 1 day buckets. Won't the resulting values be off by a lot?
Re:How PostgreSQL aggregation works and how it inspired our ... by djk447 on Friday August 06, 2021 @11:44AM (#28088736)
Under the hood we use the uddsketch percentile approximation algorithm [1], which is able to both be combined and also provides relative error guarantees. I'll also be writing a post about our percentile approximation stuff in the future that will go into more detail on this, though I'm not going to go through all the math. The basic gist is it uses a histogram with logrithmically sized buckets to give some relative error guarantees.

(NB: Post author here)

[1]: https://docs.timescale.com/api/latest/hyperfunctions/percent...