X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 929E2528C5 for ; Tue, 31 May 2005 11:06:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61283-07 for ; Tue, 31 May 2005 14:06:13 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 54694528BB for ; Tue, 31 May 2005 11:06:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j4VE6F6r011708; Tue, 31 May 2005 10:06:16 -0400 (EDT) To: "Praveen Raja" Cc: pgsql-performance@postgresql.org Subject: Re: very large table In-reply-to: <022801c565c4$6b1ac8c0$541510ac@sek.se> References: <022801c565c4$6b1ac8c0$541510ac@sek.se> Comments: In-reply-to "Praveen Raja" message dated "Tue, 31 May 2005 11:37:48 +0200" Date: Tue, 31 May 2005 10:06:15 -0400 Message-ID: <11707.1117548375@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/468 X-Sequence-Number: 12632 "Praveen Raja" 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