Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 988FB9FB2A9 for ; Wed, 17 Jan 2007 17:40:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 37201-05 for ; Wed, 17 Jan 2007 17:36:26 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by postgresql.org (Postfix) with ESMTP id EF96F9FB2BD for ; Wed, 17 Jan 2007 17:34:14 -0400 (AST) Received: by nf-out-0910.google.com with SMTP id x4so314674nfb for ; Wed, 17 Jan 2007 13:34:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=eWY0ymTE9/vE7akW2T4/BPXXh3yPdaOPUqIm3FtGn+Py+pJ6W/U9PIlX0YvPmI1q7GbrQ1P9mvWmF14HObOyFfqoT+il9vf0gsbZzZ9JWNLTx1Oe3D8onvaOFyh0yO/rHAPzrBakd/UfMxsB9m2nKw3Rm0H46pDDuDQMpChoSQo= Received: by 10.49.93.4 with SMTP id v4mr1178650nfl.1169069650459; Wed, 17 Jan 2007 13:34:10 -0800 (PST) Received: by 10.48.230.1 with HTTP; Wed, 17 Jan 2007 13:34:10 -0800 (PST) Message-ID: <81961ff50701171334t6bb6a402gc0d671643ffd714a@mail.gmail.com> Date: Wed, 17 Jan 2007 16:34:10 -0500 From: "Chad Wagner" To: Steve Subject: Re: Configuration Advice Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_190457_10607938.1169069650414" References: <1168982580.8275.1169588211@webmail.messagingengine.com> <26412.1168983547@sss.pgh.pa.us> <1168986053.16393.1169598917@webmail.messagingengine.com> <81961ff50701161444l3f932755m5a6e15ad2d948130@mail.gmail.com> <1169002739.19758.1169636285@webmail.messagingengine.com> <1169012767.6271.7.camel@localhost.localdomain> <1169044649.19974.1169715743@webmail.messagingengine.com> <1169050746.9586.44.camel@state.g2switchworks.com> <45AE79D5.9080000@fuzzy.cz> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/278 X-Sequence-Number: 22879 ------=_Part_190457_10607938.1169069650414 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/17/07, Steve wrote: > > However, each night we load data from a legacy cobol system into the SQL > system and then we summarize that data to make the reports faster. This > load process is intensely insert/update driven but also has a hefty > amount of selects as well. This load process is taking ever longer to > complete. How many rows do you typically load each night? If it is say less than 10% of the total rows, then perhaps the suggestion in the next paragraph is reasonable. SO ... our goal here is to make this load process take less time. It > seems the big part is building the big summary table; this big summary > table is currently 9 million rows big. Every night, we drop the table, > re-create it, build the 9 million rows of data (we use COPY to put hte > data in when it's prepared, not INSERT), and then build the indexes on it Perhaps, placing a trigger on the source table and building a "change log" would be useful. For example, you could scan the change log (looking for insert, update, and deletes) and integrate those changes into your summary table. Obviously if you are using complex aggregates it may not be possible to adjust the summary table, but if you are performing simple SUM's, COUNT's, etc. then this is a workable solution. -- Chad http://www.postgresqlforums.com/ ------=_Part_190457_10607938.1169069650414 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/17/07, Steve <cheetah@tanabi.org> wrote:
However, each night we load data from a legacy cobol system into the SQL
system and then we summarize that data to make the reports faster.  This
load process is intensely insert/update driven but also has a hefty
amount of selects as well.  This load process is taking ever longer to
complete.

How many rows do you typically load each night?  If it is say less than 10% of the total rows, then perhaps the suggestion in the next paragraph is reasonable.

SO ... our goal here is to make this load process take less time.  It
seems the big part is building the big summary table; this big summary
table is currently 9 million rows big.  Every night, we drop the table,
re-create it, build the 9 million rows of data (we use COPY to put hte
data in when it's prepared, not INSERT), and then build the indexes on it

Perhaps, placing a trigger on the source table and building a "change log" would be useful.  For example, you could scan the change log (looking for insert, update, and deletes) and integrate those changes into your summary table.  Obviously if you are using complex aggregates it may not be possible to adjust the summary table, but if you are performing simple SUM's, COUNT's, etc.  then this is a workable solution.


--
Chad
http://www.postgresqlforums.com/ ------=_Part_190457_10607938.1169069650414--