Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 405B6B5DCCB for ; Wed, 13 Jul 2011 15:23:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 26636-07 for ; Wed, 13 Jul 2011 18:23:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm21-vm0.bullet.mail.sp2.yahoo.com (nm21-vm0.bullet.mail.sp2.yahoo.com [98.139.91.220]) by mail.postgresql.org (Postfix) with SMTP id C70E9B5DC12 for ; Wed, 13 Jul 2011 15:23:39 -0300 (ADT) Received: from [98.139.91.66] by nm21.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2011 18:23:38 -0000 Received: from [98.136.185.40] by tm6.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2011 18:23:38 -0000 Received: from [127.0.0.1] by smtp101.mail.gq1.yahoo.com with NNFMP; 13 Jul 2011 18:23:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1310581418; bh=/nhsmFxPspT+v4ZIi2jpKSC+LnPN1WjPjxVVppR/Xkw=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=NSNaKpzQH6eWj2RNWYl+RiegjMv5VPqIImy4+PtaKVh8b/mltnDCfut7ALdfNVOgD/qdaJFOMWbmqD/XgVFs0DaN+L+0gag3KMzUAwFjYEU/wL1CgauVkjf+g1C2klwB/jNAQ2udkqtkPHcnmTWPpgM4jvd7ezLpDZJ3FXeDOW4= X-Yahoo-Newman-Id: 739601.28112.bm@smtp101.mail.gq1.yahoo.com Received: from [192.168.206.5] (lhofhansl@67.170.234.149 with plain) by smtp101.mail.gq1.yahoo.com with SMTP; 13 Jul 2011 11:23:38 -0700 PDT X-Yahoo-SMTP: YmezqLWswBDx0ai534H100MJuqGzDQ-- X-YMail-OSG: sV8SxrIVM1kfHtT41q0JdXn3YpUsNxFVN1tA7ePOqGsP8M6 Z7sZjyQpNbcAxNuNY9frCvDFVNjzBVsyOqTywy00vdhhmFmfJkoIUlnHYqEH 081bo_.gewVaLFMsvNtWJ0mawc9N6vHvvFADWeq.uZAzKSGpMC7tD36EI_Ck DwC1ffWIYw3DlQEdyPYwH6JPiy8Q9cbO7V4QAZVJYoxhkmVYEFgmYckoZd38 C3JvY62PQ3BKbgxVvgkLBtVTvHZtgBAVV7hWQnTwuci63dW9aM0YxeEVCOtz z6QOp.mWQlZr4sQvH3YKpJbvYWPaqCBYLMUef6S8Ah9LDg1LndEJOqeNPq0x cnSOPQ8iYNhnFwjw7NVluYr9cYdV.egjuaT7tgBVS X-Yahoo-Newman-Property: ymail-3 Message-ID: <4E1DE28D.6020207@yahoo.com> Date: Wed, 13 Jul 2011 11:23:09 -0700 From: lars User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Thunderbird/3.1.11 MIME-Version: 1.0 To: Kevin Grittner CC: Ivan Voras , pgsql-performance@postgresql.org Subject: Re: UPDATEDs slowing SELECTs in a fully cached database References: <4E16479D.3050605@yahoo.com> <4E1A0CBC.6090009@yahoo.com> <4E1A31AB.9010201@postnewspapers.com.au> <1310359653.80687.YahooMailRC@web121705.mail.ne1.yahoo.com> <4E1AEDAB020000250003F1C3@gw.wicourts.gov> <4E1B41EA.90104@yahoo.com> <4E1B05CC020000250003F1E6@gw.wicourts.gov> <4E1B810D.4070404@yahoo.com> <4E1B90AF.1020408@yahoo.com> <4E1C9A05.7060005@yahoo.com> <4E1C5563020000250003F252@gw.wicourts.gov> <4E1CA8E9.6090108@yahoo.com> <4E1CB56E.7080801@yahoo.com> <4E1D697C020000250003F29A@gw.wicourts.gov> In-Reply-To: <4E1D697C020000250003F29A@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/138 X-Sequence-Number: 44350 On 07/13/2011 07:46 AM, Kevin Grittner wrote: > > I've mentioned this in a hand-wavy general sense, but I should have > mentioned specifics ages ago: for a database where the active > portion of the database is fully cached, it is best to set > seq_page_cost and random_page_cost to the same value, somewhere in > the 0.1 to 0.05 range. (In your case I would use 0.05.) In highly > cached databases I have sometimes also found it necessary to > increase cpu_tuple_cost. (In your case I might try 0.02.) > I've been doing that for other tests already (I didn't want to add too many variations here). The Bitmap Heap scans through the table are only useful for spinning media and not the cache (just to state the obvious). As an aside: I found that queries in a cold database take almost twice as long when I make that change, so for spinning media this is very important. > Which raises an interesting question -- what happens to > the timings if your SELECTs are done with synchronous_commit = off? Just tried that... In that case the WAL is still written (as seen via iostat), but not synchronously by the transaction (as seen by strace). -- Lars