暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL an Quantile aggregation function for PostgreSQL

digoal 2020-03-24
295

作者

digoal

日期

2020-03-24

标签

PostgreSQL , Quantile


背景

https://github.com/tvondra/quantile

Quantile aggregates
This extension provides three simple aggregate functions to compute quantiles (http://en.wikipedia.org/wiki/Quantile). There are two forms of aggregate functions available - the first one returns a single quantile, the second one returns an arbitrary number of quantiles (as an array).

History
This extension was created in 2011, before PostgreSQL added functions to compute percentiles (percentile_cont and percentile_disc) in 9.4, which was released in December 2014. Even after introduction of those built-in functions it made sense to use this extension, because it was significantly faster in various cases.

The performance of the built-in functions improved a lot since then, and is usually very close or even faster than this extension. In some cases the extension is perhaps 2x faster than the built-in functions, but that may be (at least partially) attributed to not respecting work_mem.

It's therefore recommended to evaluate the built-in functions first, and only use this extension if it's provably (and consistently) faster than the built-in functions and the risk of running out of memory is low, or when it's necessary to support older PostgreSQL releases (pre-9.4) that do not have the built-in alternatives.

PostgreSQL 许愿链接

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

9.9元购买3个月阿里云RDS PostgreSQL实例

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

文章转载自digoal,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论