Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 88C3B13364DE for ; Mon, 31 Jan 2011 23:18:06 -0400 (AST) 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 39897-06 for ; Tue, 1 Feb 2011 03:17:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 25C43133616B for ; Mon, 31 Jan 2011 23:17:59 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p113Hvc07473; Mon, 31 Jan 2011 22:17:57 -0500 (EST) From: Bruce Momjian Message-Id: <201102010317.p113Hvc07473@momjian.us> Subject: Re: Questions on query planner, join types, and work_mem In-Reply-To: To: Robert Haas Date: Mon, 31 Jan 2011 22:17:57 -0500 (EST) CC: Tom Lane , Hannu Krosing , Peter Hussey , pgsql-performance X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1296530277-9829-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/351 X-Sequence-Number: 42138 --ELM1296530277-9829-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Robert Haas wrote: > On Wed, Aug 11, 2010 at 9:42 PM, Bruce Momjian wrote: > > This confused me. ?If we are assuing the data is in > > effective_cache_size, why are we adding sequential/random page cost to > > the query cost routines? > > See the comments for index_pages_fetched(). We basically assume that > all data starts uncached at the beginning of each query - in fact, > each plan node. effective_cache_size only measures the chances that > if we hit the same block again later in the execution of something > like a nested-loop-with-inner-indexscan, it'll still be in cache. > > It's an extremely weak knob, and unless you have tables or indices > that are larger than RAM, the only mistake you can make is setting it > too low. The attached patch documents that there is no assumption that data remains in the disk cache between queries. I thought this information might be helpful. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --ELM1296530277-9829-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/effective.diff" diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 77cacdd..520170b 100644 *** a/doc/src/sgml/config.sgml --- b/doc/src/sgml/config.sgml *************** SET ENABLE_SEQSCAN TO OFF; *** 2424,2430 **** space. This parameter has no effect on the size of shared memory allocated by PostgreSQL, nor does it reserve kernel disk cache; it is used only for estimation ! purposes. The default is 128 megabytes (128MB). --- 2424,2432 ---- space. This parameter has no effect on the size of shared memory allocated by PostgreSQL, nor does it reserve kernel disk cache; it is used only for estimation ! purposes. The system also does not assume data remains in ! the disk cache between queries. The default is 128 megabytes ! (128MB). --ELM1296530277-9829-0_--