Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id BA9612E0189 for ; Wed, 28 May 2008 22:03:55 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 35725-01-5 for ; Wed, 28 May 2008 22:03:36 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from oxford.xeocode.com (87-127-95-198.no-dns-yet.enta.net [87.127.95.198]) by developer.postgresql.org (Postfix) with ESMTP id 04FB32E005C for ; Wed, 28 May 2008 21:26:01 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.69) (envelope-from ) id 1K1Vxt-0001i9-As; Wed, 28 May 2008 20:25:57 -0400 To: Cc: Subject: Re: 2GB or not 2GB In-Reply-To: <200805281659.26945.josh@agliodbs.com> (Josh Berkus's message of "Wed\, 28 May 2008 16\:59\:26 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 5813) References: <200805281659.26945.josh@agliodbs.com> From: Gregory Stark Organization: EnterpriseDB Date: Wed, 28 May 2008 20:25:57 -0400 Message-ID: <87d4n6nega.fsf@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/362 X-Sequence-Number: 30330 "Josh Berkus" writes: > sort_mem: My tests with 8.2 and DBT3 seemed to show that, due to > limitations of our tape sort algorithm, allocating over 2GB for a single > sort had no benefit. However, Magnus and others have claimed otherwise. > Has this improved in 8.3? Simon previously pointed out that we have some problems in our tape sort algorithm with large values of work_mem. If the tape is "large enough" to generate some number of output tapes then increasing the heap size doesn't buy us any reduction in the future passes. And managing very large heaps is a fairly large amount of cpu time itself. The problem of course is that we never know if it's "large enough". We talked at one point about having a heuristic where we start the heap relatively small and double it (adding one row) whenever we find we're starting a new tape. Not sure how that would work out though. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's On-Demand Production Tuning