Re: Strategy for doing number-crunching
| От | Matthew Foster |
|---|---|
| Тема | Re: Strategy for doing number-crunching |
| Дата | |
| Msg-id | CAP1ZYZGiic53RbHdj5vC=3QVXpmZ01CwB_b5_dcPrYdn7=G2Aw@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: Strategy for doing number-crunching (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Strategy for doing number-crunching
|
| Список | pgsql-novice |
On Wed, Jan 4, 2012 at 10:48 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Matthew Foster <matthew.foster@noaa.gov> writes:What datatype are the columns being averaged? If "numeric", consider
> We have a database with approximately 130M rows, and we need to produce
> statistics (e.g. mean, standard deviation, etc.) on the data. Right now,
> we're generating these stats via a single SELECT, and it is extremely
> slow...like it can take hours to return results.
casting to float8 before applying the aggregates. You'll lose some
precision but it'll likely be orders of magnitude faster.
regards, tom lane
Tom,
The data are type double.
Matt
В списке pgsql-novice по дате отправления: