Re: [SQL] "SELECT IN" Still Broken in 7.4b

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Dani Oderbolz <oderbolz(at)ecologic(dot)de>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [SQL] "SELECT IN" Still Broken in 7.4b
Date: 2003-08-21 21:18:04
Message-ID: p0dakv05anhoqgmmgipbmpk9dhsdcm73pe@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

On Thu, 21 Aug 2003 16:42:20 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2003-08-21 21:19:47 Re: [SQL] "SELECT IN" Still Broken in 7.4b
Previous Message Tom Lane 2003-08-21 21:16:50 Re: Decent VACUUM (was: Buglist)

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-08-21 21:19:47 Re: [SQL] "SELECT IN" Still Broken in 7.4b
Previous Message Stephan Szabo 2003-08-21 21:07:08 Re: [SQL] "SELECT IN" Still Broken in 7.4b