Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9B0D96502E9 for ; Thu, 11 Dec 2008 13:22:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 34687-01 for ; Thu, 11 Dec 2008 13:22:12 -0400 (AST) X-Greylist: delayed 00:06:42.093593 by SQLgrey-1.7.6 Received: from mail-bw0-f14.google.com (mail-bw0-f14.google.com [209.85.218.14]) by mail.postgresql.org (Postfix) with ESMTP id 5A9496502EB for ; Thu, 11 Dec 2008 13:22:12 -0400 (AST) Received: by bwz7 with SMTP id 7so2211044bwz.19 for ; Thu, 11 Dec 2008 09:22:10 -0800 (PST) Received: by 10.223.106.12 with SMTP id v12mr3054312fao.16.1229015466764; Thu, 11 Dec 2008 09:11:06 -0800 (PST) Received: by 10.223.125.139 with HTTP; Thu, 11 Dec 2008 09:11:06 -0800 (PST) Message-ID: <4136ffa0812110911x4914a951o6ca502879e3dede7@mail.gmail.com> Date: Thu, 11 Dec 2008 17:11:06 +0000 From: "Greg Stark" To: "Tom Lane" Subject: Re: posix_fadvise v22 Cc: "ITAGAKI Takahiro" , Postgres In-Reply-To: <8347.1229012970@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8347.1229012970@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/796 X-Sequence-Number: 129425 On Thu, Dec 11, 2008 at 4:29 PM, Tom Lane wrote: > Greg Stark writes: >>> A variable prefetch_pages is defined as "unsigned" or "int" >>> in some places. Why don't you define it only once in a header >>> and include the header in source files? > >> Just... Which header? > > MHO: the header that goes with the source file that is most concerned with > implementing the variable's behavior (which is also the file that should > have the actual variable definition). Well the trick here is that the variable actually affects how many PrefetchBuffer() calls *callers* should make. The callers are various places which are doing lots of ReadBuffer calls and know what buffer's they'll need in the future. The main places are in nodeBitmapHeapScan.c and nbtsearch.c. Neither of those are remotely relevant. I think i'm settling in that it should be in the same place as the PrefetchBuffer() prototype since anyone who needs prefetch_buffers will need that as well (except for guc.c). So I'll put it in bufmgr.h for now. -- greg