X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id D0298D1B481 for ; Fri, 30 Jan 2004 19:27:50 +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 73703-01 for ; Fri, 30 Jan 2004 15:27:51 -0400 (AST) Received: from volta.gene.com (unknown [192.12.78.250]) by svr1.postgresql.org (Postfix) with ESMTP id 61132D1B488 for ; Fri, 30 Jan 2004 15:27:48 -0400 (AST) Received: from tallac.gene.com (tallac.gene.com [128.137.187.213]) by volta.gene.com (Switch-3.1.0/Switch-3.1.0) with ESMTP id i0UJRYqv005266 for ; Fri, 30 Jan 2004 11:27:34 -0800 (PST) Received: by tallac.gene.com (Postfix, from userid 13922) id C75704B37C; Fri, 30 Jan 2004 11:27:33 -0800 (PST) Subject: Re: query optimization differs between view and explicit From: Reece Hart To: pgsql-performance In-Reply-To: <4862.1075440407@sss.pgh.pa.us> References: <1075422699.4062.164.camel@tallac> <20040129171201.I35951@megazone.bigpanda.com> <4862.1075440407@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="=-zhDQFa59GTOlHX0/OjT8" Message-Id: <1075490853.16553.109.camel@tallac> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 30 Jan 2004 11:27:33 -0800 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/333 X-Sequence-Number: 5507 --=-zhDQFa59GTOlHX0/OjT8 Content-Type: text/plain Content-Transfer-Encoding: 7bit Stephan, Tom- Thanks. I now see that DISTINCT can't be moved within the plan as I thought. This is exactly the thinko that I was hoping someone would expose. I've decided to abandon the DISTINCT clause. The view is more general and sufficiently fast without it, and callers can always add it themselves to achieve what I was doing in the explicit query. I appreciate your time. -Reece -- Reece Hart, http://www.in-machina.com/~reece/, GPG:0x25EC91A0 --=-zhDQFa59GTOlHX0/OjT8 Content-Type: text/html; charset=utf-8 Stephan, Tom-

Thanks. I now see that DISTINCT can't be moved within the plan as I thought. This is exactly the thinko that I was hoping someone would expose.

I've decided to abandon the DISTINCT clause. The view is more general and sufficiently fast without it, and callers can always add it themselves to achieve what I was doing in the explicit query.

I appreciate your time.

-Reece

-- 
Reece Hart, http://www.in-machina.com/~reece/, GPG:0x25EC91A0
--=-zhDQFa59GTOlHX0/OjT8--