Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 21DF31336DB6 for ; Fri, 1 Oct 2010 10:52:23 -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 36785-02 for ; Fri, 1 Oct 2010 13:52:18 +0000 (UTC) X-Greylist: delayed 00:06:38.259323 by SQLgrey-1.7.6 Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [91.121.27.225]) by mail.postgresql.org (Postfix) with SMTP id 96A74133655C for ; Fri, 1 Oct 2010 10:52:15 -0300 (ADT) Received: (qmail 24092 invoked by uid 503); 1 Oct 2010 13:50:43 -0000 Received: from b9.ovh.net (HELO mail620.ha.ovh.net) (213.186.33.59) by 26.mail-out.ovh.net with SMTP; 1 Oct 2010 13:50:43 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 1 Oct 2010 15:45:37 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 1 Oct 2010 15:45:37 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: =?utf-8?Q?Fabr=C3=ADcio_dos_Anjos_Silva?= , "Craig Ringer" Cc: pgsql-performance@postgresql.org Subject: Re: How does PG know if data is in memory? References: <4CA5D2F5.5070900@postnewspapers.com.au> Date: Fri, 01 Oct 2010 15:45:34 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: <4CA5D2F5.5070900@postnewspapers.com.au> User-Agent: Opera Mail/10.62 (Linux) X-Ovh-Tracer-Id: 16573528105217689097 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N 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, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/6 X-Sequence-Number: 40425 > It sounds horrendously complicated to keep track of to me, and in the > end it won't make query execution any faster, it'll just potentially > help the planner pick a better plan. I wonder if that'd be worth the > extra CPU time spent managing the cache and cache content stats, and > using those cache stats when planning? It'd be an interesting > experiment, but the outcome is hardly obvious. Well, suppose you pick an index scan, the only way to know which index (and heap) pages you'll need is to actually do the index scan... which isn't really something you'd do when planning. So you scan,