Re: Strategy for doing number-crunching

From: Matthew Foster <matthew(dot)foster(at)noaa(dot)gov>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Strategy for doing number-crunching
Date: 2012-01-04 18:28:23
Message-ID: CAP1ZYZGiic53RbHdj5vC=3QVXpmZ01CwB_b5_dcPrYdn7=G2Aw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Wed, Jan 4, 2012 at 10:48 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Matthew Foster <matthew(dot)foster(at)noaa(dot)gov> writes:
> > 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.
>
> What datatype are the columns being averaged? If "numeric", consider
> 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2012-01-04 21:11:21 Re: Strategy for doing number-crunching
Previous Message Jean-Yves F. Barbier 2012-01-04 17:08:24 Re: Strategy for doing number-crunching