Thomas Lockhart <lockhart@alumni.caltech.edu> writes:
> How about using int8 for the accumulator (on machines which support it
> of course)? Falling back to float8 or numeric on other machines?
int8 would still pose some overflow risk (at least for int8 input),
and would likely be no faster than a float8 implementation, since
both would require palloc().
Your test suggests that the performance differential is *at most*
2X --- probably much less in real-world situations where the disk
pages aren't already cached. I can't get excited about introducing
platform-dependent behavior and overflow risk for that. If it were
10X then I would, but right now I think we are OK as is. I think
any speedup efforts here would be better put into making NUMERIC
ops go faster ...
regards, tom lane