Re: very large table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Praveen Raja" <praveen(dot)raja(at)netlight(dot)se>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: very large table
Date: 2005-05-31 14:06:15
Message-ID: 11707.1117548375@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Praveen Raja" <praveen(dot)raja(at)netlight(dot)se> writes:
> I'm trying to move an existing solution from MySQL to PostgreSQL. As it
> is now the solution has 4 tables where data in inserted by an
> application. At regular intervals (10min) data from these tables is
> consolidated and moved to another table for reporting purposes. There
> exist many instances of these reporting tables and in total they are
> expected to hold about 500 million rows. There are about 200 of these
> reporting tables at the moment with data split among them. When a
> request comes in all these tables are searched. While moving to
> PostgreSQL is it a good idea to move from using multiple tables to one
> table for so many rows?

If the multiple tables represent a partitioning scheme that makes sense
to your application (ie, you can tell a priori which tables to look in
for a given query) then it's probably worth keeping. But it sounds like
they don't make that much sense, since you mention searching all the tables.
In that case you should think about consolidating.

There is lots of stuff in the recent list archives about partitioned
tables; might be worth reading, even though much of it is talking about
features we don't yet have. It would point out the issues you need
to think about --- for example, do you periodically discard some of the
data, and if so do the tables correspond to the discard units? DROP
TABLE is a lot quicker than trying to DELETE and then VACUUM a portion
of a very large table.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-05-31 14:33:33 Re: slow queries, possibly disk io
Previous Message Josh Close 2005-05-31 13:17:31 Re: slow queries, possibly disk io