Taking best advantage of dostats
Posted in 2003
Topics: General Discussion
A dostats user sent me a question (and suggestion for an enhancement) related to his environment. Their main application creates a few large permanent and static tables every day so maintaining an update stats script is an ongoing problem. He has several VERY large tables that he likes to run stats on in parallel to speed the run and many highly static tables that are much smaller also. I thought the suggested solution I came up with would be generally useful so here it is: Meanwhile, try setting up multiple table name list files balancing the sizes of tables listed in each file. That will take care of the permanent tables and you can add more list files (perhaps on the fly using a query of the new tablenames are patterned) to handle the new tables that have been around a while. Then you can run multiple copies of dostats using the -i@file option, one per list file, and then one more copy using -x@file1 -x@file2 .... to pick up any new files you did not plan for. So the crontab script would look something like: FileArgs='' for listfile in $INFORMIXDIR/tablelists/*; do dostats -d mydatabase -tnone -i@$listfile -b -B10.0 & FileArgs="$FileArgs -x@$listfile" done dostats -d mydatabase -tall $FileArgs & #This one handles tables not listed wait This script need never change just add new files to the tablelists sub-dir and/or edit the existing ones to balance the load and add new tables when the cleanup job starts running too long. Also you could include a separate dostats using a listfile not in the tablelists subdir (or change the wildcard to ignore it) that lists tables that require different parameters, say -a -A30 but no -b option for completely static tables or a -r option to improve MEDIUM level resolution for those tables. Anyway, some suggested uses of dostats many options, FWIW. Art S. Kagel
We've been doing something similar with scripts for while now, no C compiler so no dostats. We have one table listing per CPUVP, and try to balance on the size of tables and the number of operations. Seems to work OK. "ART KAGEL, ...." wrote: > > A dostats user sent me a question (and suggestion for an enhancement) related to > his environment. Their main application creates a few large permanent and > static tables every day so maintaining an update stats script is an ongoing > problem. He has several VERY large tables that he likes to run stats on in > parallel to speed the run and many highly static tables that are much smaller > also. I thought the suggested solution I came up with would be generally useful > so here it is: > > Meanwhile, try setting up multiple table name list files balancing the sizes of > tables listed in each file. That will take care of the permanent tables and you > can add more list files (perhaps on the fly using a query of the new tablenames > are patterned) to handle the new tables that have been around a while. Then > you can run multiple copies of dostats using the -i@file option, one per list > file, and then one more copy using -x@file1 -x@file2 .... to pick up any new > files you did not plan for. So the crontab script would look something like: > > FileArgs='' > for listfile in $INFORMIXDIR/tablelists/*; do > dostats -d mydatabase -tnone -i@$listfile -b -B10.0 & > FileArgs="$FileArgs -x@$listfile" > done > dostats -d mydatabase -tall $FileArgs & #This one handles tables not listed > wait > > This script need never change just add new files to the tablelists sub-dir > and/or edit the existing ones to balance the load and add new tables when the > cleanup job starts running too long. Also you could include a separate dostats > using a listfile not in the tablelists subdir (or change the wildcard to ignore > it) that lists tables that require different parameters, say -a -A30 but no -b > option for completely static tables or a -r option to improve MEDIUM level > resolution for those tables. Anyway, some suggested uses of dostats many > options, FWIW. > > Art S. Kagel -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #