Can UPDATE STATISTICS screw up the optimizer?
Posted in 1996
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 statisticsload 100 rows
update statisticsrun the procedure
the procedure takes 30 seconds.
On the other hand, if we do:
delete all rows in the table
update statisticsload 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