/*****************************************************************************/ /* Description: This program is disgned to execute the update statistics */ /* for a database. The program will update the statistics according to the */ /* following rules: */ /* Tables with less than 5000 (default) rows: Update high for entire table */ /* Tables with more than 5000 (default) rows: Update low for entire table */ /* Columns that head an index: Update high for those columns only */ /* Columns that are indexed: Update medium for those columns only */ /* All procedures are updated after the tables are updated */ /* The spatial histogram option accepts L,M,H,l,m,h. The upper case has */ /* specifies Low,Medium,High and to complies with small table value. */ /* Using the lower case options override the small table value for */ /* tables that have a spatial column. If the the table is smaller than */ /* small table value, and spatial histogram paramter is 'l', then the */ /* non spatial columns with be updated high, whilst the spatial column */ /* will be updated low. Spatial histogram of 'L' would confirm to the */ /* small table value. */ /* */ /* The program accepts several parameters, but the main paramter is the */ /* number of update statistics statements to execute at once (in parallel). */ /* By running more than one update statistics statement at once, it is */ /* possible to keep the host busy, saturating the CPU and/or disk. The */ /* number of parallel processes executing is automatically maintained by the */ /* program. The largest table are updated first, since they will typically */ /* take the longest to complete. */ /* */ /* Another important paramter is the maximum table size (number of rows). */ /* Only tables that currrently have less rows than the maximum specified */ /* will have there statistics updated. This parameter can be used to reduce */ /* the time taken to update statistics for a database to to fit within the */ /* required time window. Obviously all tables should be updated at some */ /* point, but small tables are more likely to change significantly than */ /* larger tables */ /* */ /* The row count change minimum requires some careful usage. This option */ /* allows you to specify a minimum change in the number of rows that are */ /* currently in the table, compared to the number when the statistics were */ /* last updated. Be careful using this option, as a table may change is */ /* distribution, without changing it's total record count significantly. The */ /* minmum change only affects tables larger than $small_table. */ /* */ /* The program can also be supplied with an optional file name, the file */ /* contains table names with an optional (-+=) sign. When used with the -+ */ /* it either excludes (-) the table from being processed regardless, or */ /* includes (+) regardless. If the table name does not contain either a -+, */ /* then it is considered a complete list of the tables to process. */ /* */ /* Obviously this program is supplied without warranty, but if do find any */ /* problems, or have some suggestions, then please email me your suggestions */ /* */ /* Author: Greg Sinclair (Greg@GreatImage.com.au, sinclair@au1.ibm.com) */ /* */ /*****************************************************************************/