| From: | Greg Stark <gsstark(at)mit(dot)edu> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Hrishikesh (हृषीकेश मेहेंदळे) <hashinclude(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: Performance issues with large amounts of time-series data |
| Date: | 2009-08-26 20:42:35 |
| Message-ID: | 407d949e0908261342o7d45978cqa8fa54e96b3bc5d6@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-performance |
2009/8/26 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> How does a float ("REAL") compare in terms of SUM()s ?
>
> Casting to float or float8 is certainly a useful alternative if you
> don't mind the potential for roundoff error. On any non-ancient
> platform those will be considerably faster than numeric. BTW,
> I think that 8.4 might be noticeably faster than 8.3 for summing
> floats, because of the switch to pass-by-value for them.
It occurs to me we could build a special case state variable which
contains a bigint or a numeric only if it actually overflows. This
would be like my other suggestion with dates only it would never be
exposed. The final function would always convert to a numeric.
Alternatively we could change the numeric data type as was proposed
aeons ago but make it more general so it stores integers that fit in a
bigint as a 64-bit integer internally. That would be more work but be
more generally useful. I'm not sure it would be possible to avoid
generating palloc garbage for sum() that way though.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Guillaume Smet | 2009-08-26 21:59:25 | Re: Performance regression between 8.3 and 8.4 on heavy text indexing |
| Previous Message | Jeff Davis | 2009-08-26 20:16:29 | Re: How to create a multi-column index with 2 dates using 'gist'? |