QAQQINI - optimizing queries (World Writer, DREAM writer, etc.)

Eric Lehti

VIP Member
Are you optimizing and debugging your queries by duplicating QSYS/QAQQINI to QUSRSYS?
Do you use CHGQRYA?
or UPDATE qusrsys/QAQQINI SET QQVAL='*YES'
WHERE QQPARM='MESSAGES_DEBUG'
or UPDATE qusrsys/QAQQINI SET QQVAL=7200
WHERE QQPARM='QUERY_TIME_LIMIT'


http://www.itjungle.com/fhg/fhg082405-story03.html
http://www.itjungle.com/mgo/mgo091203-story01.html

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/rzajq/rzajqmst102.htm


Message . . . . : Query options retrieved file QAQQINI in library QUSRSYS.
Recovery . . . : Query options retrieved file QAQQINI in library QUSRSYS.
00 08/11/08 15:47:38.963808 QQQQUERY QSYS *STMT QSQRUN3 QSYS
From module . . . . . . . . : QQQQUERY
From procedure . . . . . . : QQQQUERY
Statement . . . . . . . . . : 15138
To module . . . . . . . . . : QSQOPEN
To procedure . . . . . . . : FULL_OPEN
Statement . . . . . . . . . : 20552
Message . . . . : **** Starting optimizer debug message for query .
Cause . . . . . : The optimizer debug messages that follow provide query
optimization information about how the query was implemented. This message
is the first debug message for the query and indicates the start of a set of
debug messages. Debug message CPI434B marks the end of the debug messages
for this specific query. All the debug messages in between this message and . . .
Cause . . . . . : The OS/400 Query optimizer considered all access paths
built over member F42199 of file F42199 in library AMSDTA. The list below
shows the access paths considered. If file F42199 in library AMSDTA is a
logical file then the access paths specified are actually built over member
F42199 of physical file F42199 in library AMSDTA. 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. AMSDTA/F42199LX 11, AMSDTA/F42199LY 11, AMSDTA/F42199LW
11, AMSDTA/F42199LV 11, AMSDTA/F42199LZ 12, AMSDTA/F42199L3 17,
AMSDTA/F42199L2 0, AMSDTA/F42199LF 17, AMSDTA/F42199LE 4, AMSDTA/F42199LD
17, AMSDTA/F42199LC 17, AMSDTA/F42199LB 17, AMSDTA/F42199LA 17. 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
 
Here is a 300-page book.
iSeries DB2 Universal Database for iSeries Database Performance and Query Optimization Version 5 Release 3
/SNIP
Control long-running queries with the Predictive Query Governor The DB2 Universal Database for iSeries Predictive Query Governor can stop the initiation of a query if the estimated or predicted run time (elapsed execution time) for the query is excessive. The governor acts before a query is run instead of while a query is run. The governor can be used in any interactive or batch job on the iSeries. It can be used with all DB2 Universal Database for iSeries query interfaces and is not limited to use with SQL queries. The ability of the governor to predict and stop queries before they are started is important because: v Operating a long-running query and abnormally ending the query before obtaining any results wastes server resources. v Some operations within a query cannot be interrupted by the End Request (ENDRQS) CL command. The creation of a temporary index or a query using a column function without a GROUP BY clause are two examples of these types of queries. It is important to not start these operations if they will take longer than the user wants to wait.The governor in DB2 Universal Database for iSeries is based on the estimated runtime for a query. If the query’s estimated runtime exceeds the user defined time limit, the initiation of the query can be stopped. To define a time limit for the governor to use, do one of the following: v Use the Query Time Limit (QRYTIMLMT) parameter on the Change Query Attributes (CHGQRYA) CL command. This is the first place where the query optimizer attempts to find the time limit. v Set the Query Time Limit option in the query options file. This is the second place where the query optimizer attempts to find the time limit. v Set the QQRYTIMLMT system value. Allow each job to use the value *SYSVAL on the CHGQRYA CL command, and set the query options file to
 
Back
Top