CPI432A - Query optimizer timed out for file &1

CPI432A
Message Text: Query optimizer timed out for file &1.
Cause Text: The query optimizer timed out before it could consider all access paths built over member &3 of file &1 in library &2.

The list below shows the access paths considered before the optimizer timed out. If file &1 in library &2 is a logical file then the access paths specified are actually built over member &9 of physical file &7 in library &8.

Following each access path name in the list is a reason code which explains why the access path was not used. A reason code of 0 indicates that the access path was used to implement the query.

The reason codes and their meanings follow:
  1. Access path was not in a valid state. The system invalidated the access path.
  2. Access path was not in a valid state. The user requested that the access path be rebuilt.
  3. Access path is a temporary access path (resides in library QTEMP) and was not specified as the file to be queried.
  4. The cost to use this access path, as determined by the optimizer, was higher than the cost associated with the chosen access method.
  5. The keys of the access path did not match the fields specified for the ordering/grouping criteria.
  6. The keys of the access path did not match the fields specified for the join criteria.
  7. Use of this access path would not minimize delays when reading records from the file as the user requested.
  8. The access path cannot be used for a secondary file of the join query because it contains static select/omit selection criteria. The join-type of the query does not allow the use of select/omit access paths for secondary files.
  9. File &1 contains record ID selection. The join-type of the query forces a temporary access path to be built to process the record ID selection.
  10. and greater - View the second level message text of the next message issued (CPI432D) for an explanation of these reason codes.
Recovery Text: To ensure an access path is considered for optimization specify that access path to be the queried file. The optimizer will first consider the access path of the file specified on the query. SQL-created indexes cannot be queried but can be deleted and recreated to increase the chance they will be considered during query optimization.

The user may want to delete any access paths no longer needed.

The optimizer stops considering indexes when the time spent optimizing the query exceeds an internal value that corresponds to the estimated time to run the query and the number of rows in the queried tables. Generally, the more rows in the tables, the greater the number of indexes that will be considered.

When the estimated time to run the query is exceeded, the optimizer does not consider any more indexes and uses the current best method to implement the query. Either an index has been found to get the best performance, or an index will have to be created. If the actual time to execute the query exceeds the estimated run time this may indicate the optimizer did not consider the best index.

The message help contains a list of indexes that were considered before the optimizer timed out. By viewing this list of indexes, you may be able to determine if the optimizer timed out before the best index was considered.

To ensure that an index is considered for optimization, specify the logical file associated with the index as the table to be queried. The optimizer will consider the index of the table specified on the query or SQL statement first. Remember that SQL indexes cannot be queried.

You may want to delete any indexes that are no longer needed.

Related reference
CPI432D - Additional access path reason codes were used