Tuesday, September 17, 2013

Overview on Database Statistics


Scenario:

This scenario occurred during the production support activity for our retail client. The timelines for the load
completion is very critical for our account since the dependencies are more. One such situation occurred
where the activation step for an DSO was stuck for a very long time. On checking the Activation Job Logs,
we found that the job was performing the statistics recalculation as shown in the screenshot below.
This paves way for the document on ‘Database Statistics during DSO Activation’
.
Overview on Database Statistics:

During the DSO activation process the statistics are generated for both ‘00’ (Active table) and ‘40’ (New
Table) tables of the DSO. This can under circumstances slow down the activation process. However this
step is essential for query performance over the DSO.
Note: The Statistics recalculation step does not trigger every time the activation job is executed. This is not a periodic event as well. This process starts when the statistics seemed to have been corrupted.
Ignoring Statistics Recalculation & Resetting:

The statistics recalculation step at times causes an overhead during critical data load activation processes.
For example: Consider the scenario where the DSO data has to be pushed further to a series of Infocubes
on time and the process is stuck in the activation step of the DSO.

The Statistics step can be ignored using the Report: RSSM_SUPPRESS_STATISTICS
Note: The above program mentioned ‘RSSM_SUPPRESS_STATISTICS’ is to be used during the activation process.

Also note that the statistics will have to be manually generated if this option is used.
Procedure to Ignore Statistics Recalculation:
1. Go to SE38 and type the program RSSM_SUPPRESS_STATISTICS and Execute.
2. The program RSSM_SUPRESS_STATISTICS has option to enter the DSO name and it gives 2
checkboxes. The check boxes work according to the following logic. Database Statistics During DSO Activation

1. Check DB St. Deactivated before Act and Check DB St. Deactivated after Act: This option will
suppress the Statistics step totally for the particular DSO.
2. Check DB St. Deactivated before Act and Uncheck DB St. Deactivated After Act: This option will
suppress the Statistics step before the Activation Step and Enable it after the Activation is
complete.(recommended)
3. Uncheck DB St. Deactivated Before Act and Check DB St. Deactivated After Act: This option will
suppress the Statistics step after the Activation Step (not recommended as it would have no effect).
4. Uncheck DB St. Deactivated Before Act and Uncheck DB St. Deactivated After Act: This option will
enable the Statistics step totally for the particular DSO.

Let us proceed with Step 2:

3. Once the above step is executed with DSO name the following screen appears:
4. This program basically changes the fields of the Table RSODSSETTINGS. Database Statistics During DSO Activation

Procedure to Reset the Statistics Settings:

1. Go to SE38 and type the program RSSM_SUPPRESS_STATISTICS and Execute
2. Enter the DSO name and Execute. Please note that the both the check boxes are to be unchecked.
3. Once the above step is executed the following screen appears:Database Statistics During DSO Activation
4. The changes are reverted back in the Table RSODSSETTINGS

Statistics Status During the above Process:

The Statistics will not be generated once the above process is followed. It has to be manually generated from
DB02 for the particular DSO.

Old Statistics:

The performance of the old statistics cannot be conclusive as the decision factor is on how well the current
data set is represented.

Disadvantages of Database Statistics:

Every change happening on the statistics can cause changes to the optimizer. In most of the cases regular
update of statistics will have a positive effect on performance

No comments:

Post a Comment