The database system needs the SQL Optimizer statistics to determine the optimal search strategy for accessing data when executing complex SQL statements.
Recommendation
Update the statistics once a week.
Update the statistics also in the following cases:
If the size proportions or values in the database tables have changed significantly
If you have upgraded the database (for example, from version 7.6 to version 7.7)
Update the statistics at a time of minimal work load.
You are logged on to the database as database system administrator or as a DBM operator with server authorization for accessing an SQL session.
More information: Glossary, Server Permission
The database is in the ONLINE operational state.
In the context menu of the table, choose Definition.
Open the Optimizer Statistics tab page.
Choose Update in the context menu of the Table Statistics field.
Define the sample type and sample size that you want the system to use to generate the statistics.
Number of Data Records (Sample Type Rows) |
Proportion of Data Records as Percentage of all Data Records in the Table (Sample Size Percent) |
Description |
---|---|---|
0 |
0 |
The system does not update any statistics for the table. |
0 < Number of data records < Number of data records in the table The default value for the sample size is 20,000 data records. |
0 < Percentage of data records < 100 % For large tables (> 1,000,000 data records) in SAP systems, we recommend a sample size of 5 %. |
The system uses the sample size specified to estimate the statistics. |
Number of all data records in the table |
100 % |
The system calculates the statistics. This usually takes much longer than an estimation using a sample. |
Note
You defined default values when you created the table. To change these default values, change the table properties (in the Miscellaneous tab page).
More information: Changing Table Properties
The system updates the table statistics.
Property |
Description |
---|---|
Columns and Indexes |
Columns and indexes |
Distinct Values |
Estimated number of lines in the table |
Page Count |
Estimated table size (in pages) This size affects which search strategy is selected by the system. More information: SQL Optimizer, Search Strategies |
Last Statistics Update |
Time of the last statistics update |
See Activating or Deactivating the Automatic SQL Optimizer Statistics Update
Database Administration, SQL Optimizer Statistics
SAP Note 927882