Load Optimizer Statistics from a Text File
To load optimizer statistics from a text file, use the optimizedb -i (input) flag, which will load one or more sets of values from the file.
For example, if the file arelbrel.dat contains statistics for the arel and brel tables, these can be loaded into the database using the command:
optimizedb -i arelbrel.dat mydb
In Director, use the Generate Statistics dialog, Input/Output File page, Statistics Input Filename field.
In VDBA, use the Read Statistics from Server File option in the Optimize Database dialog.
Load Statistics for Selected Tables or Columns
If the input file contains statistics for multiple tables, you can load selected tables or columns by specifying the optimizedb ‑r (read selected tables) and ‑a (read selected columns) flags.
For example, if the file arelbrel.dat contains statistics for the arel and brel tables, only the statistics for arel can be loaded into the database using the command:
optimizedb -i arelbrel.dat mydb -rarel
Only statistics for column col3 of the table are loaded with the following command:
optimizedb -i arelbrel.dat mydb -rarel -acol3
In VDBA, use the Read Statistics from Server File option with the Specify Tables and Specify Columns check boxes in the Optimize Database dialog.
Update Row and Page Counts
The input file for the optimization process contains information about the number of rows, as well as primary and overflow page counts in a table. However, because these values are critical to correct operation, these input values are normally disregarded when creating statistics, leaving the catalog values untouched.
You can force the values in the input file to be used when loading the statistics by specifying the ‑zp flag. For example:
optimizedb -i arelbrel.dat -zp mydb -rarel
In VDBA, enable the Read Row and Page check box in the Optimize Database dialog.
Important! This option must be used with extreme care, because it sets critical values.
This option can be useful for certain specialized processing, such as query modeling and performance problem debugging. Bear in mind that the row count value can be modified for the table and its indexes. However, the page count is modified for the table only—the index page count values remains unchanged.