X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6AC79329D8A for ; Wed, 8 Sep 2004 15:50:12 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00451-08 for ; Wed, 8 Sep 2004 14:50:02 +0000 (GMT) Received: from mercure.sigma.fr (mercure-1.sigma.fr [195.25.81.8]) by svr1.postgresql.org (Postfix) with ESMTP id 872D0329D87 for ; Wed, 8 Sep 2004 15:50:03 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by mercure.sigma.fr (Postfix) with ESMTP id C53B374F6; Wed, 8 Sep 2004 16:50:02 +0200 (CEST) Received: from mercure.sigma.fr ([127.0.0.1]) by localhost (mercure-1 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07651-09; Wed, 8 Sep 2004 16:50:02 +0200 (CEST) Received: from marc.sigma.fr (unknown [89.195.0.5]) by mercure.sigma.fr (Postfix) with ESMTP id 92E9E747B; Wed, 8 Sep 2004 16:50:02 +0200 (CEST) From: Marc Cousin Organization: Sigma Informatique To: Tom Lane Subject: Re: Problem with large query Date: Wed, 8 Sep 2004 16:49:59 +0200 User-Agent: KMail/1.7 References: <200409081549.49537.mcousin@sigma.fr> <20149.1094654443@sss.pgh.pa.us> In-Reply-To: <20149.1094654443@sss.pgh.pa.us> Cc: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409081650.00228.mcousin@sigma.fr> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at sigma.fr X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/50 X-Sequence-Number: 8178 The query has been generated by business objects ... i'ill try to suggest to the developpers to remove this constant (if they can)... The fields used by the sort are of type numeric(6,0) or (10,0) ... Could it be better if the fields were integer or anything else ? On Wednesday 08 September 2004 16:40, you wrote: > Marc Cousin writes: > > I'm having trouble with a (quite big) query, and can't find a way to make it > > faster. > > Seems like it might help if the thing could use a HashAggregate instead > of sort/group. Numeric is not hashable, so having those TO_NUMBER > constants in GROUP BY destroys this option instantly ... but why in the > world are you grouping by constants anyway? You didn't say what the > datatypes of the other columns were... > > regards, tom lane >