Re: Nested queries V/S Joins
Posted in 1996
Michael Behna wrote: >A join should always be faster. However, it is very important taht the indices >be up to date i.e. update statistics is very important. Also on some versions, >the order that the indices are built is very important. The optimizer does not >always use the right index and some times it uses the first index that matches >instead of the right one. Er, no. On a 486 SCO Xenix (!) V4 SE site, we found that there was a (relatively small) number of records where this was not true. Table a had +- 2000 records, table b had +- 50000 records, and a subquery ran in 2 seconds, a join in 20 seconds (ceteris paribus). V4 is (allegedly) index order independent, and UPDATE STISITICS had been run. FWIW. -- Cheers, Billy. -------------------------------------------------------------------------------- billy.wheeler@pixie.co.za +27 11 803 2151 p.o. box 3463, rivonia, rsa, 2128 +27 83 250 2324 informix developer at large (and i mean _large_) --------------------------------------------------------------------------------