User Guide > Performance Tuning > Creating Cardinality Statistics for Cost-Based Optimization > Scheduling Cardinality Statistics Refresh
 
Scheduling Cardinality Statistics Refresh
You can schedule statistics gathering to happen at the best time for you. Use the following procedure, or refer to the steps in Using TDV API Procedures to Refresh or Cancel Resource Statistics.
To schedule refreshes of the cardinality statistics
1. Follow the instructions in Creating Cardinality Statistics for a View or Creating Cardinality Statistics on a Data Source.
2. Set the statistics gathering schedules for one of the following:
Manual—Use Gather Now for immediate collection of statistics. If your cache is controlled by a cache policy, use a periodic or programmatic refresh.
Exactly Once—Requires that you set a day and time in the future to run.
Periodic—Statistics collection occurs at timed intervals, such as at an off-peak hour each night.
Frequency of statistics gathering also depends on data volatility. Some tables never change and others change frequently. Gather statistics based on the expected frequency of cardinality and table boundary change.
It is best to use off-peak hours for gathering data source statistics. You can use multiple threads for data sources that support parallel processing.
3. Use the Stats Gathering Timeout field to specify the number of minutes permitted for gathering data from a resource.
A value of 0 (zero; the default) indicates that there is no time limit.
If the timeout expires when statistics gathering is already returning data, the timeout triggers an attempt to make statistical estimates from the subset of data already returned.
4. Save your selections.