X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C47A132A5DA for ; Thu, 7 Oct 2004 02:30:06 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15330-01 for ; Thu, 7 Oct 2004 01:29:53 +0000 (GMT) Received: from sue.samurai.com (sue.samurai.com [205.207.28.74]) by svr1.postgresql.org (Postfix) with ESMTP id 0F0A132A5ED for ; Thu, 7 Oct 2004 02:29:56 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by sue.samurai.com (Postfix) with ESMTP id 18382197CE; Wed, 6 Oct 2004 21:29:57 -0400 (EDT) Received: from sue.samurai.com ([127.0.0.1]) by localhost (sue.samurai.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 54699-01-3; Wed, 6 Oct 2004 21:29:55 -0400 (EDT) Received: from localhost (unknown [61.88.101.19]) by sue.samurai.com (Postfix) with ESMTP id 6B1BE197A8; Wed, 6 Oct 2004 21:29:53 -0400 (EDT) Subject: Re: The never ending quest for clarity on shared_buffers From: Neil Conway To: Paul Ramsey Cc: Doug Y , pgsql-performance@postgresql.org In-Reply-To: <41647127.3060407@refractions.net> References: <6.1.2.0.2.20041006152747.033bcd50@pop.traderonline.com> <41647127.3060407@refractions.net> Content-Type: text/plain Message-Id: <1097112547.13119.108.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 07 Oct 2004 11:29:07 +1000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/75 X-Sequence-Number: 8551 On Thu, 2004-10-07 at 08:26, Paul Ramsey wrote: > The shared_buffers are shared (go figure) :). It is all one pool shared > by all connections. Yeah, I thought this was pretty clear. Doug, can you elaborate on where you saw the misleading docs? > The sort_mem and vacuum_mem are *per*connection* however, so when > allocating that size you have to take into account your > expected number of concurrent connections. Allocations of size `sort_mem' can actually can actually happen several times within a *single* connection (if the query plan happens to involve a number of sort steps or hash tables) -- the limit is on the amount of memory that will be used for a single sort/hash table. So choosing the right figure is actually a little more complex than that. -Neil