Re: Can UPDATE STATISTICS screw up the optimizer?
Posted in 1996
What is setting of OPTCOMPIND ? Although 'by the book' indicates 2 should be best ... we've gotten some odd 'optimizations' we can't seem to explain. -Lin BasharChalabi wrote: : He have a stored procedure that updates all records in a table in a : foreach loop. Within the loop, it selects records from the table it is : updating as well as other (static) tables, all with less than 1000 rows. : If we do the following: : delete all rows in the table : update statistics : load 100 rows : update statistics : run the procedure : the procedure takes 30 seconds. : On the other hand, if we do: : delete all rows in the table : update statistics : load 100 rows : run the procedure : it takes 7 seconds!!! : Can update statistics actually screw up the optimizer? If so, when? : We tried low, medium and high statistics, to the same effect. : Platform is Online 7.1 on SCO OSR5, Pentium PRO 200MHz, 128MB RAM. : Bashar Chalabi : Card Tech Limited : bashar@ctl.com