Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 249D3DDBC2A for ; Fri, 2 Dec 2011 15:49:55 -0400 (AST) Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RWZ7L-00026Z-1i for pgsql-performance@postgresql.org; Fri, 02 Dec 2011 19:49:55 +0000 Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id pB2Jng821759; Fri, 2 Dec 2011 14:49:42 -0500 (EST) From: Bruce Momjian Message-Id: <201112021949.pB2Jng821759@momjian.us> Subject: Re: Intersect/Union X AND/OR In-Reply-To: To: Thiago Godoi Date: Fri, 2 Dec 2011 14:49:42 -0500 (EST) CC: pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201112/9 X-Sequence-Number: 45809 Thiago Godoi wrote: > Hi all, > > I found this presentation from B. Momjian: > > http://momjian.us/main/writings/pgsql/performance.pdf > > I'm interested in what he said about " Intersect/Union X AND/OR " , Can I > find a transcription or a video of this presentation? Can anyone explain it > to me? Well, there is a recording of the webcast on the EnterpriseDB web site, but I am afraid they only allow viewing of 3+ hour webcasts by EnterpriseDB customers. The idea is that a query that uses an OR can be rewritten as two SELECTs with a UNION between them. I have seen rare cases where this is a win, so I mentioned it in that talk. Intersection is similarly possible for AND in WHERE clauses. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +