X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0F4BAD1BC54 for ; Thu, 21 Aug 2003 18:17:53 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 57226-02 for ; Thu, 21 Aug 2003 18:17:22 -0300 (ADT) Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) by svr1.postgresql.org (Postfix) with SMTP id 31563D1C4BF for ; Thu, 21 Aug 2003 18:17:18 -0300 (ADT) Received: (qmail 73166 invoked from network); 21 Aug 2003 21:17:06 -0000 Received: from m167p003.dipool.highway.telekom.at (HELO cantor) ([62.46.10.195]) (envelope-sender ) by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 21 Aug 2003 21:17:06 -0000 From: Manfred Koizar To: Tom Lane Cc: Stephan Szabo , Dani Oderbolz , pgsql-hackers@postgreSQL.org Subject: Re: [SQL] "SELECT IN" Still Broken in 7.4b Date: Thu, 21 Aug 2003 23:18:04 +0200 Message-ID: References: <20030821102627.C51705-100000@megazone.bigpanda.com> <25062.1061498540@sss.pgh.pa.us> In-Reply-To: <25062.1061498540@sss.pgh.pa.us> X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/967 X-Sequence-Number: 42624 On Thu, 21 Aug 2003 16:42:20 -0400, Tom Lane wrote: >The point is that given > WHERE a = 1 OR b = 1 >you could create a plan that first indexscans on a, then indexscans on >b --- but you mustn't return any tuples in the second scan that you >already returned in the first. IndexNext solves this by evaluating the >prior-scan index conditions to see if they are true. WHERE a = 1 OR b = 2 and WHERE a = 1 OR a = 2 are totally different things. In the latter case you don't have to check prior conditions because the conditions are mutually exclusive. Is this reasonably easy to find out at plan creation time? Yes, I changed your example to make my point clear, because WHERE a = 1 OR a = 1 has its own set of problems. Servus Manfred