Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XeS6O-0007o9-KV for pgsql-performance@arkaria.postgresql.org; Wed, 15 Oct 2014 17:11:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XeS6O-0005F4-43 for pgsql-performance@arkaria.postgresql.org; Wed, 15 Oct 2014 17:11:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XeS6N-0005E5-3j for pgsql-performance@postgresql.org; Wed, 15 Oct 2014 17:11:07 +0000 Received: from 01.zmailcloud.com ([192.198.85.104] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XeS6J-0004A8-OW for pgsql-performance@postgresql.org; Wed, 15 Oct 2014 17:11:05 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 6C6F3564892; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 63B0E602B3; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8O72go_8i5GQ; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 40C1F602B7; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 2AA89602BC; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nLZARziVaeSb; Wed, 15 Oct 2014 12:11:02 -0500 (CDT) Received: from [172.47.23.103] (70-36-143-82.dsl.dynamic.fusionbroadband.com [70.36.143.82]) by smtp-out-2.01.com (Postfix) with ESMTPSA id AE44E602A2; Wed, 15 Oct 2014 12:11:01 -0500 (CDT) Message-ID: <543EAAA2.8010701@agliodbs.com> Date: Wed, 15 Oct 2014 10:10:58 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Dave Johansen , pgsql-performance Subject: Re: Partitions and work_mem? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 10/14/2014 10:08 AM, Dave Johansen wrote: > I'm running Postgres 8.4 on RHEL 6 64-bit and I had a question about how > work_mem and partitions interact. > > https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server#work_mem > The above wiki states that "if a query involves doing merge sorts of 8 > tables, that requires 8 times work_mem." If I have a table that is > partitioned does each partition count as a "table" and get its on work_mem? In theory, this could happen. In practice, based on tests I did at Sun with DBT3 and 8.3, no backend ever used more than 3X work_mem. This is partly because the level of parallelism in postgres is extremely limited, so we can't actually sort 8 partitions at the same time. BTW, 8.4 is EOL. Maybe time to upgrade? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance