Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 9CCAD9FAE4E for ; Thu, 28 Sep 2006 12:18:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 06456-05 for ; Thu, 28 Sep 2006 15:18:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from larry.aptalaska.net (larry.aptalaska.net [64.186.96.3]) by postgresql.org (Postfix) with ESMTP id 1570B9F9F96 for ; Thu, 28 Sep 2006 12:18:44 -0300 (ADT) Received: from [192.168.98.9] (rdbck-static-287.palmer.mtaonline.net [64.4.232.33]) (authenticated bits=0) by larry.aptalaska.net (8.13.8/8.13.6) with ESMTP id k8SFIcE7013631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Sep 2006 07:18:39 -0800 Message-ID: <451BE7CD.3060807@aptalaska.net> Date: Thu, 28 Sep 2006 07:18:37 -0800 From: Matthew Schumacher User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Marcin Mank CC: pgsql-performance@postgresql.org Subject: Re: Problems with inconsistant query performance. References: <451AC4E2.90106@aptalaska.net> <1c9501c6e2fb$91e30200$0c67a8c0@maniek> In-Reply-To: <1c9501c6e2fb$91e30200$0c67a8c0@maniek> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Bayes: Learn: unavailable X-Scanned-By: MIMEDefang 2.56 on 64.186.96.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/383 X-Sequence-Number: 21069 Marcin Mank wrote: >> So the question is why on a relatively simple proc and I getting a query >> performance delta between 3549ms and 7ms? > > What version of PG is it? > > I had such problems in a pseudo-realtime app I use here with Postgres, and > they went away when I moved to 8.1 (from 7.4). I guess it is better shared > buffer management code (don`t You see a > big_query_searching_through_half_the_db just before You get this slow > insert? ) . > > Greetings > Marcin > Marcin, It is 8.1.4, and there is searching being done on the radutmp_tab all of the time. It is relatively small though, only a couple of thousand rows. The tmpaccounting_tab table which also gets inserts is only used for inserting, then one large query every night to flush the data to an indexed table. What I really need is a way to profile my proc when it runs slow so that I can resolve which of the queries is really slow. Anyone with an idea on how to do this? schu