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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
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:46:03
Message-ID: 28348.1061502363@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
> 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?

Yeah, I know, but I see no easy way to verify this (where "easy" means
"doesn't take an unreasonable amount of time"). A naive check would
take O(N^2) time, putting you right back where you started. Even a
smart check would surely take more time per item than one hashtable probe.
I'm also concerned about how much the planner would have to assume about
the semantics of the operators in order to prove the conditions are
mutually exclusive.

Finally, I suspect that once we get rid of the O(N^2) behavior in the
executor, we will find that the next biggest bottleneck is in the
planner; adding more work for it to do per OR-clause item will make
things worse not better.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Frank van Vugt 2003-08-21 21:51:42 Re: postgresql 7.3.2 bug on date '1901-12-13' and '1901-12
Previous Message Manfred Koizar 2003-08-21 21:43:21 Re: Buglist

Browse pgsql-sql by date

  From Date Subject
Next Message Joe Conway 2003-08-21 22:01:46 Re: [SQL] "SELECT IN" Still Broken in 7.4b
Previous Message Josh Berkus 2003-08-21 21:19:47 Re: [SQL] "SELECT IN" Still Broken in 7.4b