Re: SELECT AND AGG huge tables

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: SELECT AND AGG huge tables
Дата
Msg-id CAMkU=1wre+8mroYUvEYBArGTpifdV5P8Hk6NuEp9XizNSyQQVg@mail.gmail.com
обсуждение исходный текст
Ответ на SELECT AND AGG huge tables  (houmanb <houman@gmx.at>)
Список pgsql-performance
On Mon, Oct 15, 2012 at 1:59 PM, houmanb <houman@gmx.at> wrote:
> Dear all,
> We have a DB containing transactional data.
> There are about *50* to *100 x 10^6* rows in one *huge* table.
> We are using postgres 9.1.6 on linux with a *SSD card on PCIex* providing us
> a constant seeking time.
>
> A typical select (see below) takes about 200 secs. As the database is the
> backend for a web-based reporting facility 200 to 500 or even more secs
> response times are not acceptable for the customer.
>
> Is there any way to speed up select statements like this:
>
> SELECT
>    SUM(T.x),
>    SUM(T.y),
>    SUM(T.z),
>    AVG(T.a),
>    AVG(T.b)
> FROM T
> GROUP BY
>    T.c
> WHERE
>    T.creation_date=$SOME_DATE;
>
> There is an Index on T.c. But would it help to partition the table by T.c?

Probably not.

But an index on creation_date, or on (creation_date, c) might.  How
many records are there per day?  If you add a count(*) to your select,
what would typical values be?

Cheers,

Jeff


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

Предыдущее
От: Bob Lunney
Дата:
Сообщение: Re: SELECT AND AGG huge tables
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: SELECT AND AGG huge tables