On Sun, 7 Jul 2024 at 13:43, Joel Jacobson wrote:
>
> > SELECT hash_array(array_agg(width_bucket(op, b1, b2, c))) FROM t;
> > -- Result not changed by patch
>
> Same hash_array on all my three machines:
>
> > SELECT sum(width_bucket(op, b1, b2, c)) FROM t;
> > Time: 3658.962 ms (00:03.659) -- HEA
🔥
On Sun, Jul 7, 2024, 7:44 AM Joel Jacobson wrote:
> On Sat, Jul 6, 2024, at 17:36, Dean Rasheed wrote:
> > In the numeric width_bucket() code, we currently do the following:
> ..
> > Instead, this can be done more simply and efficiently, using division
> > with truncation as follows:
> ..
> >
On Sat, Jul 6, 2024, at 17:36, Dean Rasheed wrote:
> In the numeric width_bucket() code, we currently do the following:
..
> Instead, this can be done more simply and efficiently, using division
> with truncation as follows:
..
>
> Patch attached. I didn't bother with any new test cases, since ther
In the numeric width_bucket() code, we currently do the following:
mul_var(&operand_var, count_var, &operand_var,
operand_var.dscale + count_var->dscale);
div_var(&operand_var, &bound2_var, result_var,
select_div_scale(&operand_var, &bound2_var), true);
if (cmp