16. Using the Query Optimizer : Specialized Statistics Processing : Statistics in Text Files
 
Share this page                  
Statistics in Text Files
The optimization process can directly read a set of optimizer statistics from an external text file, rapidly updating the statistics for specific database tables. This can be useful when:
Information is being moved from one database to another (for example, using copydb), and you want to copy the statistics for the tables as well.
You know the distribution of the data in a table and want to read or input these values directly, instead of letting the optimization process generate them for you.
The actual table data is ignored. This gives you a modeling ability, because the table can actually be empty but there are statistics that indicate the presence of data and its distribution. The query optimizer uses those false statistics to determine a QEP. For more information, see Query Execution Plans. This gives the DBA the ability to verify correctness of QEPs without having to load data into tables.
The text file read by the optimization process can be created in one of two ways:
When displaying statistics, you can unload statistics that already exist in the database and use the generated file as input to the optimization process.
You can create an input file from scratch or by editing a file created when displaying statistics.