Re: avg(int2) and avg(int8) micro-opt

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: avg(int2) and avg(int8) micro-opt
Date: 2005-04-05 02:04:06
Message-ID: 4992.1112666646@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> Tom Lane wrote:
>> Why only those two? Might as well make all the accum functions look alike.

> Yeah, there might be some others we could improve. float4_accum() and
> float8_accum() look like they could be improved pretty easily, and
> do_numeric_accum() should also be fixable with some hackery. I suppose
> it's also worth optimizing int2_sum(), int4_sum() and int8_sum(). I'll
> send a patch for this later today or tomorrow. Are there any other
> transition functions where we can apply this technique?

Actually, do_numeric_accum can't be fixed easily because numeric is a
varlena type. The basic requirement for this hack is that the size of
the transition value be constant ...

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2005-04-05 02:15:04 Re: DELETE ... USING
Previous Message Neil Conway 2005-04-05 01:18:05 Re: DELETE ... USING