CMS Redbook Overview

Page 47

about the data source capabilities (such as disk I/O capabilities) and about the data itself. In general, many access plans and variations are examined before the most optimum access plan is chosen based on the available information. Depending on the type of query compilation and access plan, evaluation is done at different points in time: For Static SQL, the SQL query is embedded in some application program and explicitly bound to the database during the process of making this application program executable. In this case, compilation of the SQL query and evaluation of access plans is done once during the process of binding the application. For performance reasons, the access plan is then stored so that it can be reused whenever the query is perform. Nevertheless, the user might (and should!) explicitly request to recompile a query whenever any of the facts has changed that led the compiler to its choice of access plan, especially whenever the system catalog statistics have been updated as described in “System catalog statistics” on page 46. For Dynamic SQL, including all SQL queries that are entered in some interactive query tool, the SQL query is compiled whenever it is submitted to the database for execution. DB2 might apply some intelligent query caching to avoid recompiling identical queries, but this is not under full control of the user. The access plan is the key when it comes to the performance of an individual query. Although an access plan is something internal and not automatically exposed to the user, DB2 provides means to visualize and analyze it. (In Chapter 11, “Performance monitoring, analysis, and tracing” on page 281, we show how to use these tools.) An access plan might be poor or good. In a situation when there is just a specific query that shows a poor performance, analysis of the access plan of this query typically provides the clue to the resolution of the performance problem. Key points: An access plan of a query represents the database manager’s query execution model. The query optimizer selects the optimum access plan based on various information. The access plan is the key element to look at when analyzing performance problems of individual queries.

Indexes An index can be viewed as a means to support efficient access to data in a database table. An index always covers a set of columns of the underlying table, and after it is defined it can be used by the query optimizer to choose an access

40

Performance Tuning for Content Manager


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.