Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 26D29632346 for ; Wed, 4 Aug 2010 14:51:18 -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 09174-03 for ; Wed, 4 Aug 2010 17:51:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from serenity.inversion.ee (serenity.inversion.ee [194.204.33.112]) by mail.postgresql.org (Postfix) with ESMTP id 969556326B2 for ; Wed, 4 Aug 2010 14:51:10 -0300 (ADT) Received: by serenity.inversion.ee (Postfix, from userid 108) id 12627E34473; Wed, 4 Aug 2010 19:32:22 +0300 (EEST) Received: from [IPv6:::1] (localhost [127.0.0.1]) by serenity.inversion.ee (Postfix) with ESMTP id 4CB45E3432C; Wed, 4 Aug 2010 19:32:21 +0300 (EEST) Subject: Re: Questions on query planner, join types, and work_mem From: Hannu Krosing To: Robert Haas Cc: Peter Hussey , Tom Lane , pgsql-performance In-Reply-To: References: <18551.1280275502@sss.pgh.pa.us> <25534.1280498632@sss.pgh.pa.us> <1280819031.14579.38.camel@hvost> Content-Type: text/plain; charset="UTF-8" Date: Wed, 04 Aug 2010 20:51:08 +0300 Message-ID: <1280944268.3735.12.camel@hvost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit 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: 201008/48 X-Sequence-Number: 39891 On Wed, 2010-08-04 at 09:14 -0400, Robert Haas wrote: > On Tue, Aug 3, 2010 at 3:03 AM, Hannu Krosing wrote: > > In case of fully cached database it is closer to 1. > > In the case of a fully cached database I believe the correct answer > begins with a decimal point. The number 1 here was suggested in relation to seq_page_cost, which is 1. For fully cached db there is no additional seek time for random access, so seq_page_cost == random_page_cost. Of course there are more variables than just *_page_cost, so if you nail down any other one, you may end with less than 1 for both page costs. I have always used seq_page_cost = 1 in my thinking and adjusted others relative to it. -- Hannu Krosing http://www.2ndQuadrant.com PostgreSQL Scalability and Availability Services, Consulting and Training