CPI4323 - The query access plan has been rebuilt

CPI4323
Message Text: The query access plan has been rebuilt.
Cause Text: The access plan was rebuilt for reason code &13. The reason codes and their meanings follow:
  1. A file or member is not the same object as the one referred to in the access plan. Some reasons include the object being re-created, restored, or overridden to a new object.
  2. Access plan was using a reusable Open Data Path (ODP), and the optimizer chose to use a non-reusable ODP.
  3. Access plan was using a non-reusable Open Data Path (ODP) and the optimizer chose to use a reusable ODP
  4. The number of records in member &3 of file &1 in library &2 has changed by more than 10%.
  5. A new access path exists over member &6 of file &4 in library &5.
  6. An access path over member &9 of file &7 in library &8 that was used for this access plan no longer exists or is no longer valid.
  7. The query access plan had to be rebuilt because of system programming changes.
  8. The CCSID (Coded Character Set Identifier) of the current job is different than the CCSID used in the access plan
  9. The value of one of the following is different in the current job: date format, date separator, time format, or time separator.
  10. The sort sequence table specified has changed.
  11. The number of active processors or the size or paging option of the storage pool has changed.
  12. The system feature DB2® UDB Symmetric Multiprocessing has either been installed or removed.
  13. The value of the degree query attribute has changed either by the CHGSYSVAL or CHGQRYA CL commands or with the query options file &15 in library &16.
  14. A view is either being opened by a high level language open, or is being materialized.
  15. A sequence object or user-defined type or function is not the same object as the one referred to in the access plan; or, the SQL path used to generate the access plan is different than the current SQL path.
  16. Query attributes have been specified from the query options file &15 in library &16.
  17. The access plan was generated with a commitment control level that is different in the current job.
  18. The access plan was generated with a different static cursor answer set size.
  19. This is the first run of the query since a prepare or compile.
  20. or greater. View the second level message text of the next message issued (CPI4351) for an explanation of these reason codes.
If the reason code is 4, 5, 6, 20, or 21 and the file specified in the reason code explanation is a logical file, then member &12 of physical file &10 in library &11 is the file with the specified change.
Recovery Text: Excessive rebuilds should be avoided and may indicate an application design problem.

This message can be sent for a variety of reasons. The specific reason is provided in the message help.

Most of the time, this message is sent when the queried table environment has changed, making the current access plan obsolete. An example of the table environment changing is when an index required by the query no longer exists on the server.

An access plan contains the instructions for how a query is to be run and lists the indexes for running the query. If a needed index is no longer available, the query is again optimized, and a new access plan is created, replacing the old one.

The process of again optimizing the query and building a new access plan at runtime is a function of DB2 UDB for iSeries™. It allows a query to be run as efficiently as possible, using the most current state of the database without user intervention.

The infrequent appearance of this message is not a cause for action. For example, this message will be sent when an SQL package is run the first time after a restore, or anytime the optimizer detects that a change has occurred (such as a new index was created), that warrants an implicit rebuild. However, excessive rebuilds should be avoided because extra query processing will occur. Excessive rebuilds may indicate a possible application design problem or inefficient database management practices.

Related reference
CPI4351 - Additional reason codes for query access plan has been rebuilt.
CPI434C - The query access plan was not rebuilt