X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CC2A89DCBDF for ; Fri, 13 Jan 2006 19:34:55 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 20995-03 for ; Fri, 13 Jan 2006 19:34:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 224DB9DCB75 for ; Fri, 13 Jan 2006 19:34:51 -0400 (AST) Received: by noel.decibel.org (Postfix, from userid 1001) id D295D3983F; Fri, 13 Jan 2006 17:34:54 -0600 (CST) Date: Fri, 13 Jan 2006 17:34:54 -0600 From: "Jim C. Nasby" To: Bendik Rognlien Johansen Cc: pgsql-performance@postgresql.org Subject: Re: Slow query with joins Message-ID: <20060113233454.GM9017@pervasive.com> References: <13028.1136994347@sss.pgh.pa.us> <65451320-7D72-4544-A8E8-CD93212E4A5D@gmail.com> <20060111202345.GC63175@pervasive.com> <850AD6F9-08BD-4EF2-A549-407FD87C7974@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <850AD6F9-08BD-4EF2-A549-407FD87C7974@gmail.com> X-Operating-System: FreeBSD 6.0-RELEASE amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.089 required=5 tests=[AWL=0.089] X-Spam-Score: 0.089 X-Spam-Level: X-Archive-Number: 200601/170 X-Sequence-Number: 16648 On Wed, Jan 11, 2006 at 10:30:58PM +0100, Bendik Rognlien Johansen wrote: > The sort is definitively the culprit. When I removed it the query was > instant. I tried setting work_mem = 131072 but it did not seem to > help. I really don't understand this :-( Any other ideas? What's explain analyze show with the sort in? -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461