Taking best advantage of dostats
Posted in 2005
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 sending to informix-list
ART KAGEL, BLOOMBERG/ 65E 55TH wrote: Now I'm sure this is a year old. I moved offices from 65E 55th in February 2004! Something's very hinky with the email interface. Ignore unless you missed it the first time and find this interesting. Art S. Kagel > 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 > > > sending to informix-list