Re: IN vs. OR on performance

2009-03-30 Thread Baron Schwartz
On Sun, Mar 29, 2009 at 10:19 AM, Claudio Nanni wrote: > An explain of the two statements yields the same plan, > anybody knows if they are actually translated in the same plan? There is a difference. The IN list is sorted so lookups can be done as a binary search. A bunch of OR's just evaluate

Re: IN vs. OR on performance

2009-03-29 Thread Claudio Nanni
An explain of the two statements yields the same plan, anybody knows if they are actually translated in the same plan? Claudio Ian P. Christian wrote: 2009/3/29 Oscar : Hi all- I want to know what the difference between IN and OR is under the hood. select * from dummy_table where id in (2

RE: IN vs. OR on performance

2009-03-29 Thread Martin Gainty
mation purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided. > Date: Sun, 29 Mar 2009 09:13:10 + > Subject: Re: IN vs. OR on performance > From: poo...@pookey.

Re: IN vs. OR on performance

2009-03-29 Thread Ian P. Christian
2009/3/29 Oscar : > Hi all- > > I want to know what the difference between IN and OR is under the hood. > > select * from dummy_table where id in (2, 3, 4, 5, 6, 7); > > select * from dummy_table where id=2 or id=3 or id=4 or id=5 or id=6 or > id=7; I've have thought once the query is compiled, th

IN vs. OR on performance

2009-03-28 Thread Oscar
Hi all- I want to know what the difference between IN and OR is under the hood. select * from dummy_table where id in (2, 3, 4, 5, 6, 7); select * from dummy_table where id=2 or id=3 or id=4 or id=5 or id=6 or id=7; I run the query sql on the test schema, it seems that there is no performance d