Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 487FD9F9509 for ; Fri, 9 Nov 2007 13:56:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 40146-01 for ; Fri, 9 Nov 2007 13:56:28 -0400 (AST) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by postgresql.org (Postfix) with ESMTP id E3AB49F94F9 for ; Fri, 9 Nov 2007 13:56:35 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c10so89601ana for ; Fri, 09 Nov 2007 09:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=/h86cZjgMOLAAFYhH6vOTk3BERIZgd0Mf2H3wdCESE4=; b=prHu3wvt7UQAMJcTZTdJU4ITq/lJE2fT9oxuFdCiKdQEXiBlnsQUkUC9X7Kglba7YEljH39IgqHfeVADv01Dk4fxZYdpKwnn3JccDkTOJwKonFtf64VBq7y0KkKPd026JqtplGG5tYo20C6LjX2fN8uGOFnkt2vljjyCLNQT7qk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=EvI92MYdgoTzVfT5flhldVsIhLjY0QQyUtzOaA5FiBquy8FERsbrkqS603gqW8KTC6bnxTUuL0q2zzG8ybsWs45aiPY/7ueOp26IoGrG0i98XeoXnn5BPJjN2c1kwDTuPRtn5+mZQ+T7gdIdoL1EQUUzokQAy1FYgxSMNMgP20M= Received: by 10.100.229.10 with SMTP id b10mr3329801anh.1194630994170; Fri, 09 Nov 2007 09:56:34 -0800 (PST) Received: from ?172.24.32.184? ( [62.232.55.118]) by mx.google.com with ESMTPS id d26sm162242nfh.2007.11.09.09.56.31 (version=SSLv3 cipher=RC4-MD5); Fri, 09 Nov 2007 09:56:32 -0800 (PST) Message-ID: <47349F4E.5070204@enterprisedb.com> Date: Fri, 09 Nov 2007 17:56:30 +0000 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: "Campbell, Lance" CC: pgsql-performance@postgresql.org Subject: Re: work_mem and shared_buffers References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/145 X-Sequence-Number: 27560 Campbell, Lance wrote: > Does the amount of memory allocate to work_mem get subtracted from > shared_buffers? > > Example: > > If work_mem is 1M and there are 10 connections and shared_buffers is > 100M then would the total be 90 M left for shared_buffers? > > Or does the amount of memory allocated for work_mem have nothing to do > with shared_buffers? No, they're completely separate. Note that a connection can use more than work_mem of memory. For example, if you run a query with multiple Sort or hash-nodes, each such node allocates up to work_mem of memory. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com