Updating Table Statistics

Update column-related statistics such as histograms and densities.

The Adaptive Server cost-based optimizer uses statistics about the tables, indexes, and columns named in a query to estimate query costs. It chooses the access method that offers the lowest cost as determined by the optimizer. Cost estimates rely on accurate statistics.

Updating statistics at the table level applies only to user tables.
  1. In the Perspective Resources view, select the server on which the table resides, then click the drop-down arrow next to the server name and select Administration Console.
  2. In the left pane of the Administration Console, expand ASE Servers > Schema Objects > Tables and select User Tables.
  3. Select a table for which to update statistics.
    Only one table can be selected for update.
  4. Select Update Statistics.
    The Update Statistics wizard appears.
  5. In the Options window, choose one of the following:
    • Generate statistics for the leading column in each index.

    • Generate statistics for all columns in each index.
  6. (Optional) Click Use sampling, then enter the sampling percentage.
    The percentage to use when sampling depends on your needs. Test various percentages until you receive a result that reflects the most accurate information on a particular data set.
  7. (Optional) Click Use step number, then enter the step numbers.
    Increasing the number of steps beyond what is needed for good query optimization can affect performance, largely due to the amount of space that is required to store and use the statistics.
  8. (Optional) In the Automatic Update window, click on Update statistics only when datachange threshold is reached, and enter a threshold value.
    The datachange threshold determines when the amount of change in a table or partition has reached the predefined threshold.
  9. Click Finish to apply the update statistics option selections.
Related tasks
Updating Partition Statistics
Updating Index Statistics
Updating Column Statistics