Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 30EA99FA602 for ; Tue, 10 Apr 2007 15:21:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 39869-05 for ; Tue, 10 Apr 2007 15:21:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E6BDA9FA20A for ; Tue, 10 Apr 2007 15:21:26 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3AILOEj028254; Tue, 10 Apr 2007 14:21:24 -0400 (EDT) To: "Merlin Moncure" cc: "PostgreSQL Performance" Subject: Re: join to view over custom aggregate seems like it should be faster In-reply-to: References: <10651.1176152866@sss.pgh.pa.us> <27416.1176224586@sss.pgh.pa.us> Comments: In-reply-to "Merlin Moncure" message dated "Tue, 10 Apr 2007 13:53:02 -0400" Date: Tue, 10 Apr 2007 14:21:24 -0400 Message-ID: <28253.1176229284@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/235 X-Sequence-Number: 24112 "Merlin Moncure" writes: > right, i see that it's actually the 'group by' that does it: > select a, b from foo join (select a, b from bar group by a,b) q using (a,b); > is enough to keep it from using the index on a,b from bar. thats too bad... Some day it'd be nice to be able to reorder grouping/aggregation steps relative to joins, the way we can now reorder outer joins. Don't hold your breath though ... I think it'll take some pretty major surgery on the planner. regards, tom lane