Use
Various statistics are compiled for each
database instance, such as the number of table entries, the size of the tables and indices, and the value distribution (various values) of indices and columns. This information is required by the SAP DB Optimizer to define the best strategy for executing complex SQL statements.If the database size or the values it contains have changed considerably, you will have to update the statistics. This should be carried out roughly once a week.
The statistics values can be updated for certain tables, columns, or for all basic tables.
Prerequisites
The database instance is in
ONLINE mode.Procedure
Choose Instance ® Tuning ® Optimizer Statistics.
Updating statistics entries for all tables
If you then choose OptimizerStatistics ® Execute, all of the statistics entries for all of the tables are updated.
Updating statistics entries for selected tables or columns
You can also choose to update selected statistics only:
To do so, enter appropriate search arguments under
Owner, Table Name and Column Name.The reliability of the random sample depends on the size of the table and the physical position of the data. Measurements have shown that random samples of between 1000 and 5000 rows in large tables have short response times and produce high-quality results.
Owner |
Owner |
Table Name |
Table name |
Column Name |
Column name |
Estimate Rows |
Number of rows checked |
Estimate Percent |
Percentage of rows checked |
Then choose OptimizerStatistics ® Select. A list of the tables that match your criteria is then displayed. From the
Update Statistics Date and Update Statistics Time, you can tell when the statistics for this table were last updated.Choose OptimizerStatistics ® Execute to update the statistics for the selected tables.