PostgreSQL 9.5新特性 width_bucket
PostgreSQL 9.5 新增的一个函数width_bucket , 用来计算一个值在一个bucket范围内的位置信息,如果这个值超出了给定的范围,返回0或者总bucket+1。bucket除了用数字来表示,还可以直接用数组来表示。 width_bucket(operand dp,b1 dp, b2 dp, count int) int return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range b1 to b2; returns 0 or count+1 for an input outside the range width_bucket(5.35, 0.024, 10.06, 5) 3 width_bucket(operandnumeric, b1 numeric, b2numeric, count int) int return the bucket number to which operand would be assigned in a histogram having count equal-width buckets spanning the range b1 to