Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 670FE9FB7D3 for ; Thu, 28 Jun 2007 09:01:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 24937-07 for ; Thu, 28 Jun 2007 09:01:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id 1A3189FB7BA for ; Thu, 28 Jun 2007 09:01:46 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id a2so87630ugf for ; Thu, 28 Jun 2007 05:01:44 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=PVUh7OatA5x6eSs47bf1NGNrOvctrre9NoLFo76aIi0DhvmpSH4PV5UbHjTHE/u/OXHDBS7OgomCuUc9aBwmwMZ0mDXPJzMBtZj8xBAXbtPFVzfHBElkJ7agT9b4X9Lw5xVjoNP0z1mVaqb6aEY/aiOXfR1RTKKCBAYBBqDZh1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=LQxRNF58OW4VWSZrb1nhR3bkDoZh2N8dh7vpi5+4YzRlypy2PQLNZcljMdONDfYS4VXvXlXuSGCygZ2qYawR48U6wEGXKskQz6XmXF86Z0SE0VE700W4+bkFF1+1DUny+WOdrsLTy/WhUDiVxp+iKiQsLqDE1oELXND+Q8dYs8g= Received: by 10.67.118.1 with SMTP id v1mr368151ugm.1183032104908; Thu, 28 Jun 2007 05:01:44 -0700 (PDT) Received: from ?172.24.32.39? ( [62.232.55.118]) by mx.google.com with ESMTP id 24sm2200728ugf.2007.06.28.05.01.42 (version=SSLv3 cipher=RC4-MD5); Thu, 28 Jun 2007 05:01:42 -0700 (PDT) Message-ID: <4683A2FF.1090404@enterprisedb.com> Date: Thu, 28 Jun 2007 13:01:03 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Jean-David Beyer CC: Pgsql performance Subject: Re: update query taking too long References: <46834124.5010600@gmail.com> <21072.1183009270@sss.pgh.pa.us> <46835252.5070901@gmail.com> <468357B2.1040205@archonet.com> <46835A16.3050602@gmail.com> <46835D14.6010507@archonet.com> <46836EC8.20807@gmail.com> <46839F39.5020402@verizon.net> In-Reply-To: <46839F39.5020402@verizon.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/629 X-Sequence-Number: 25662 Jean-David Beyer wrote: > I have not used postgreSQL since I tried it once in about 1998 (when I found > it unsatisfactory, but much has changed since then), but I am going to try > it again. What would be a good checkpointing interval? I would guess 26 > seconds is too often. What considerations go into picking a checkpointing > interval? Welcome back. Longer is better when the system is running. But on recovery, longer checkpoint interval means a longer wait until the database is up again. Longer checkpoint interval also means that more WAL needs to be kept around, but that's not usually a concern on normal server hardware with plenty of disk space. > WAL_BUFFERS The default is 8. Increasing this can increase the performance of bulk load operations but it doesn't make much difference otherwise. > CHECKPOINT_SEGMENTS The default is 3. This would have been too low for the > O.P. Would it make sense to start with a higher value > or is this a good value and just not appropriate for > the O.P.? Should CHECKPOINT_SEGMENTS be raised until > the checkpointing is about half CHECKPOINT_TIMEOUT, > e.g., 150 seconds while the dbms is running typical > work? > CHECKPOINT_TIMEOUT The default is 300 seconds. You have to decide if you want to use checkpoint_timeout or checkpoint_segments as the primary means of controlling your checkpoint interval. checkpoint_timeout is easier to understand and tune, so I would suggest using that. Depending on how long recovery times you can live with, set it to something like 15 minutes - 60 minutes. Then set checkpoint_segments to a high value; it's purpose in this scheme is basically to just protect you from running out of disk space on the filesystem WAL is located in. Note that unlike on DB2, the size of your transactions isn't limited by the amount of transaction log you keep around; this is all about performance. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com