Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 248651337B68 for ; Wed, 13 Apr 2011 11:15:03 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 71303-06 for ; Wed, 13 Apr 2011 14:14:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id CCA181337B67 for ; Wed, 13 Apr 2011 11:14:43 -0300 (ADT) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id 3A3E915E429E; Wed, 13 Apr 2011 16:14:42 +0200 (CEST) Received: from 85.161.98.97 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Wed, 13 Apr 2011 16:14:42 +0200 Message-ID: <985a2672b882183d323bbba37e6357ae.squirrel@sq.gransy.com> In-Reply-To: References: <20110412171855.GA14292@tux> <4DA496FA.3070908@fuzzy.cz> <8F22D592-23C1-4A3C-94A5-48363332ADD3@darkstatic.com> <4DA4BFA2.5060601@fuzzy.cz> <4DA4D40A.4010200@fuzzy.cz> Date: Wed, 13 Apr 2011 16:14:42 +0200 Subject: Re: Performance From: tv@fuzzy.cz To: "Ogden" Cc: "Tomas Vondra" , pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/185 X-Sequence-Number: 43247 > Thomas, > > Thank you for your very detailed and well written description. In > conclusion, I should keep my random_page_cost (3.0) to a value more than > seq_page_cost (1.0)? Is this bad practice or will this suffice for my > setup (where the database is much bigger than the RAM in the system)? Or > is this not what you are suggesting at all? Yes, keep it that way. The fact that 'random_page_cost >= seq_page_cost' generally means that random reads are more expensive than sequential reads. The actual values are dependent but 4:1 is usually OK, unless your db fits into memory etc. The decrease of performance after descreasing random_page_cost to 3 due to changes of some execution plans (the index scan becomes slightly less expensive than seq scan), but in your case it's a false assumption. So keep it at 4 (you may even try to increase it, just to see if that improves the performance). regards Tomas