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 DB578D1EC64 for ; Tue, 23 Mar 2004 17:02:11 +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 66971-02 for ; Tue, 23 Mar 2004 13:02:06 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id D9FE2D1EC60 for ; Tue, 23 Mar 2004 13:02:00 -0400 (AST) Received: (qmail 25212 invoked by uid 500); 23 Mar 2004 17:05:00 -0000 Date: Tue, 23 Mar 2004 11:05:00 -0600 From: Bruno Wolff III To: Phil Endecott Cc: pgsql-performance@postgresql.org Subject: Re: Optimisation of INTERSECT expressions Message-ID: <20040323170500.GA25181@wolff.to> Mail-Followup-To: Phil Endecott , pgsql-performance@postgresql.org References: <20040323162823.B4131D1EC40@svr1.postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040323162823.B4131D1EC40@svr1.postgresql.org> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/312 X-Sequence-Number: 6168 On Tue, Mar 23, 2004 at 11:21:39 -0500, Phil Endecott wrote: > Does anyone have any suggestions about how to do this? I'd like a nice > general technique that works for all possible subqueries, as my current > composition with INTERSECT does. One adjustment you might make is using INTERSECT ALL if you know there can't be duplicates. Then time won't be wasted trying to remove duplicates.