pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: houmanb <houman@gmx.at>
To: pgsql-performance@postgresql.org
Subject: SELECT AND AGG huge tables
Date: Mon, 15 Oct 2012 13:59:16 -0700 (PDT)
Message-ID: <1350334756457-5728306.post@n5.nabble.com> (raw)

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?
It should be mentioned, that T.c is actually a foreign key to a Table
containing a 
tiny number of rows (15 rows representing different companies).
my postgres.conf is actually the default one, despite the fact that we
increased the value for work_mem=128MB

Thanks in advance
Houman






--
View this message in context: http://postgresql.1045698.n5.nabble.com/SELECT-AND-AGG-huge-tables-tp5728306.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.




view thread (9+ messages)  latest in thread

Message-ID: <1350334756457-5728306.post@n5.nabble.com>
Permalink:  ../1350334756457-5728306.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1350334756457-5728306.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: houman@gmx.at
  Subject: Re: SELECT AND AGG huge tables
  In-Reply-To: <1350334756457-5728306.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox