X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4E7CED1B551 for ; Fri, 9 Jan 2004 05:13:20 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 45965-02 for ; Fri, 9 Jan 2004 01:12:30 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 171B1D1B4D4 for ; Fri, 9 Jan 2004 01:12:20 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id i095C719020724; Fri, 9 Jan 2004 00:12:08 -0500 (EST) To: Mike Glover Cc: Bradley Tate , pgsql-performance@postgresql.org Subject: Re: Slow query problem In-reply-to: <20040108192716.26c4b369.mpg4@duluoz.net> References: <3FFCF005.70108@objectmastery.com> <20040108192716.26c4b369.mpg4@duluoz.net> Comments: In-reply-to Mike Glover message dated "Thu, 08 Jan 2004 19:27:16 -0800" Date: Fri, 09 Jan 2004 00:12:07 -0500 Message-ID: <20723.1073625127@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/94 X-Sequence-Number: 5269 Mike Glover writes: > You should bump sort_mem as high as you can stand. with only 8MB sort > memory available, you're swapping intermediate sort pages to disk -- > a lot. Try the query with sort_mem set to 75MB (to do the entire sort in > memory). 7.4 will probably flip over to a hash-based aggregation method, and not sort at all, once you make sort_mem large enough that it thinks the hash table will fit in sort_mem. regards, tom lane