Re: performance of IN vs ORs
Posted in 1994
Topics: Performance & Tuning
In article <3ckjj0$cc0@emory.mathcs.emory.edu>, Alan Popiel <alan@po.den.mmc.com> wrote: >} Subject: performance of IN vs ORs >} To: informix-list@vprp333q.prop.telecom.com.au >} Date: Tue, 13 Dec 1994 15:05:56 +1100 (AEDT) >} From: Ian Timms <itimms@vprp333q.prop.telecom.com.au> >} >} Does anyone have anything to say with regard to the performance >} of using IN as opposed to a group of ORs under Informix SE 4.12? >} >using the IN construct. > >I have not used the NOT IN with a small list. In general, I recommend *against* >using NOT IN with a subselect, but with a short list such as yours I could not >say for certain. MY guess (only a guess) is that the NOT IN and multiple >AND ... <> ... would have similar performance. > In a seminar book I borrowed from one of my older officemates who went to a Informix Training session, the NOT is not recommended because it will not use the index! It going to search sequential instead of by index. Well that was version 4. I don't know how version 5 or 6 or 7 handles this now. Also, with you ORs. I think you can just UNION them bec. it helps the search too: SELECT col1 WHERE colb = first_condition UNION SELECT col1 WHERE colb = first_condition UNION SELECT col1 WHERE colb = first_condition Just a lot of typing! :) SOmeone correct me if I've got my definition of union wrong...I haven't used it for a while. John