Re: Q: Update statistics
Posted in 1998
Oleg Milenkiy wrote: > > Paul, > > I am afraid, your answer is not correct for the latest versions of > informix. At least, I could not find any locks imposed by UPDATE > STATISTICS in my system (v. 7.22, AIX). > > Maybe my system is somewhat special, but I truly hope that developers of > the UPDATE STATISTICS had realized that locking is excessive: nature of > collecting statistics does not require locking. Indeed, one locks the > table, scans it, and gets the exact number, which, a second later, > becomes wrong, but still is good enough for all practical purposes. > Scanning without locking would produce number which, if users are > active, is somewhat wrong, but is good enough for all practical > purposes. The number is volotile by nature, and final result in both > cases is the same, so - why bother to lock? Indeed while ODS 5.0x did lock a table during update stats 7.xx only acquires an instantaneous lock on the sysdistribs table when it finally inserts the resulting statistics records for MEDIUM and HIGH. LOW and HIGH do the same to the table's systables record when it is updated. Art S. Kagel