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 E132F329C89 for ; Wed, 8 Sep 2004 15:40:49 +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 98089-08 for ; Wed, 8 Sep 2004 14:40:40 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id A99A0329CAE for ; Wed, 8 Sep 2004 15:40:42 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i88Eeh8N020150; Wed, 8 Sep 2004 10:40:43 -0400 (EDT) To: Marc Cousin Cc: pgsql-performance@postgresql.org Subject: Re: Problem with large query In-reply-to: <200409081549.49537.mcousin@sigma.fr> References: <200409081549.49537.mcousin@sigma.fr> Comments: In-reply-to Marc Cousin message dated "Wed, 08 Sep 2004 15:49:49 +0200" Date: Wed, 08 Sep 2004 10:40:43 -0400 Message-ID: <20149.1094654443@sss.pgh.pa.us> From: Tom Lane 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/49 X-Sequence-Number: 8177 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