Re: Strategy for doing number-crunching

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strategy for doing number-crunching
Дата
Msg-id 16291.1325695712@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Strategy for doing number-crunching  (Matthew Foster <matthew.foster@noaa.gov>)
Ответы Re: Strategy for doing number-crunching  (Matthew Foster <matthew.foster@noaa.gov>)
Список pgsql-novice
Matthew Foster <matthew.foster@noaa.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

В списке pgsql-novice по дате отправления:

Предыдущее
От: Matthew Foster
Дата:
Сообщение: Strategy for doing number-crunching
Следующее
От: Sean Davis
Дата:
Сообщение: Re: Strategy for doing number-crunching