Start of Content Area

Procedure documentation Solving Problems with Out-of-Date Optimizer Access Paths  Locate the document in its SAP Library structure

Use

When the access paths used by the Informix optimizer are out-of-date, data access gets worse. This affects especially access to large tables and views. If you run Explain SQL this often shows that the correct index is being used but that the costs for the access are still very high. This problem is worsened if the database server is not often restarted.

Database data changes dynamically during production operation. However, if the number of rows in a database table does not change, the access path is not updated by the optimizer – although the path no longer corresponds to the current data distribution. Note that the access path is always updated if statistics are updated with SAPDBA using zero deviation.

The data distribution in some database tables of the SAP System can lead the optimizer to choose a poor access path. This problem is worsened if there are large changes in the data distribution after the optimizer statistics are generated. Therefore, it is sometimes better for particular tables not to use the access path suggested by the optimizer.

Procedure

  1. Analyze the problem:

OPTCOMPIND = 0

For more information, see SAP note 143956.

select * from sysdistrib

where tabid in

(select tabid from systables

where tabname = '<table name>');

  1. Solve the problem:

delete from sysdistrib

where tabid in

(select tabid from systables

where tabname = '<table name>');

Another way to do this is by entering the following SQL command:

update statistiscs low for table <table name>

drop distributions

The second method generates new statistics and drops the distributions. Therefore, it takes longer than the first method.

Result

The statistics are more up-to-date and reflect the current data distribution. Monitor problematic tables in future and update statistics on such tables frequently, customizing the update statistics parameters if necessary.

 

See also:

Update Statistics with SAPDBA