Re: Q: Update statistics
Posted in 1998
June Tong wrote: > > Art S. Kagel wrote: > > > 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. > > Hmmm, I don't think 5.0 locked any tables during UPDATE STATS either. As I > recall, you'd have to go back to 4.x to find any table locks during UPDATE > STATS. To the best of my knowledge, 5.0 would read a table, then lock > systables/syscolumns/etc just long enough to update the rows pertaining to > that table, release those locks, and move on to the next table. 4.something > (and I don't remember what the 'something' was) would lock a table while it > was being read. In 5.0 (and for all I know, 7.x), IFF you run UPDATE STATS > within a transaction, the locks on the system catalogs are held for the > duration of the transaction, as locks always are. Therefore, you don't want > to run UPDATE STATS within a transaction. Perhaps that is what I was remembering. At any rate the important point was that 7.xx does not. Art S. Kagel