RE: Update statistics for large databases
Posted in 2007
Using dostats will help you in several ways: 1- My utils2_ak package contains drive_dostats which can break up the list of tables in your DB into N lists and run a N copies of dostats one for each sub-list. That will cut the runtime considerable. 2- UPDATE STATISTICS at the DB level requires multiple sorts. Doing it at the table level only is much more efficient and will normally complete faster. 3- Dostats' -a/-A (Aging mode) selects tables to be updated ONLY if the table's stats are older than <m> days and -b/-B (Browse mode)selects tables to be updated ONLY if the table's row count has increased or decreased by more than <X> percent. This reduces the workload to only active tables or those whose stats may be stale and is similar to Stephan's scripting. utils2_ak can be downloaded from the IIUG Software Repository. Art S. Kagel