Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9F4829F9CF6 for ; Wed, 22 Nov 2006 10:28:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 58520-04-5 for ; Wed, 22 Nov 2006 10:28:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 7E28A9FA60A for ; Wed, 22 Nov 2006 10:28:15 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (p549D17F7.dip0.t-ipconnect.de [84.157.23.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 226AB64BD9; Wed, 22 Nov 2006 15:31:01 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 0C0491866239B; Wed, 22 Nov 2006 15:28:13 +0100 (CET) Message-ID: <45645E7C.4030101@logix-tt.com> Date: Wed, 22 Nov 2006 15:28:12 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: Markus Schaber , PostgreSQL Performance List Subject: Re: PostgreSQL underestimates sorting References: <456423B3.7010505@logix-tt.com> <20061122135434.GA9669@uio.no> In-Reply-To: <20061122135434.GA9669@uio.no> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/186 X-Sequence-Number: 21956 Hi, Steinar, Steinar H. Gunderson wrote: > On Wed, Nov 22, 2006 at 11:17:23AM +0100, Markus Schaber wrote: >> The Backend allocates gigs of memory (we've set sort_mem to 1 gig), and >> then starts spilling out more Gigs of temporary data to the disk. > > How much RAM is in the server? Remember that sort_mem is _per sort_, so if > you have multiple sorts, it might allocate several multiples of the amount > you set up. That one machine has 16 Gigs of ram, and about 10 Gigs tend to be "free" / part of the Linux blocklayer cache. The temporary data is not swapping, it's the Postgres on-disk sort algorithm. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org