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 BDFBB52982 for ; Tue, 19 Jul 2005 22:51:04 -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 25475-09 for ; Wed, 20 Jul 2005 01:50:55 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.196]) by svr1.postgresql.org (Postfix) with ESMTP id 9342F529E2 for ; Tue, 19 Jul 2005 22:50:54 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id i2so1354809wra for ; Tue, 19 Jul 2005 18:50:59 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PKey9uduzS/3wiTTlxYYsSSe3sBUA6Xw5Gxi0QlM3oT766Slt67D/ol3q5TBpvm7R/9RZ1eWwTFEw4e0XT/OboGaBQ+y6Xiop+eyDZccXjRnLPh6RNRIhz3ze8/tpdp4lZGLL6hj4bttFpmZ9gKwrXwrH07WxfzngdELdzy3ogM= Received: by 10.54.125.16 with SMTP id x16mr966649wrc; Tue, 19 Jul 2005 18:50:18 -0700 (PDT) Received: by 10.54.150.2 with HTTP; Tue, 19 Jul 2005 18:50:18 -0700 (PDT) Message-ID: <1efd553a050719185059de2581@mail.gmail.com> Date: Tue, 19 Jul 2005 21:50:18 -0400 From: Oliver Crosby Reply-To: Oliver Crosby To: PFC Subject: Re: Looking for tips Cc: Sven Willenberger , Dawid Kuroczko , Kevin Grittner , jd@commandprompt.com, pgsql-performance@postgresql.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1efd553a0507191308219a098b@mail.gmail.com> <758d5e7f0507191319636afaa3@mail.gmail.com> <1efd553a050719132836c31b78@mail.gmail.com> <1121805961.3674.25.camel@lanshark.dmv.com> <1efd553a050719140462d41468@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.057 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/332 X-Sequence-Number: 13573 Sorry for the lack of specifics... We have a file generated as a list of events, one per line. Suppose lines 1,2,3,5,7,11,etc were related, then the last one would specify that it's the last event. Gradually this gets assembled by a perl script and when the last event is encountered, it gets inserted into the db. For a given table, let's say it's of the form (a,b,c) where 'a' is a pkey, 'b' is indexed, and 'c' is other related information. The most common 'b' values are cached locally with the perl script to save us having to query the db. So what we end up having is: if 'b' exists in cache, use cached 'a' value and continue else if 'b' exists in the db, use the associated 'a' value and continue else add a new line with 'b', return the new 'a' and continue The local cache was a huge time saver with mysql. I've tried making a plpgsql function that handles everything in one step on the db side, but it didn't show any improvement. Time permitting, I'll try some new approaches with changing the scripts and queries, though right now I was just hoping to tune postgresql.conf to work better with the hardware available. Thanks to everyone for your help. Very much appreciated.