SAP ABAP Data Element QQKS (iSeries: Key Selection (Database Monitor))
Hierarchy
SAP_BASIS (Software Component) SAP Basis Component
   BC-DB-DB4 (Application Component) DB2 for AS/400
     STU4 (Package) CCMS / AS/400
Basic Data
Data Element QQKS
Short Description iSeries: Key Selection (Database Monitor)  
Data Type
Category of Dictionary Type D   Domain
Type of Object Referenced     No Information
Domain / Name of Reference Type QQYN    
Data Type CHAR   Character String 
Length 1    
Decimal Places 0    
Output Length 1    
Value Table      
Further Characteristics
Search Help: Name    
Search Help: Parameters    
Parameter ID   
Default Component name    
Change document    
No Input History    
Basic direction is set to LTR    
No BIDI Filtering    
Field Label
  Length  Field Label  
Short 11 Key Sel. 
Medium 21 Key Selection 
Long 41 Key Selection 
Heading 55 Key Selection 
Documentation

Definition

QQKS indicates if the key selection access method was used to implement a statement.
Y = Key selection access method was used
N = Key selection access method was not used

In the case of the file-based monitor (STRDBMON/ENDDBMON), QQKS is available only for records with QQRID 3001 and 3002, QQILNM/QQILNM is the index used for key positioning.

In the case of the memory-resident database monitor, QQKS is only available in the detail information tables SQ3001_DB4 and SQ3002_DB4, QQILNM/QQILNM is the index used for key positioning.

Note

The key selection access method:
The entire index is read and any selection criteria that references the key fields of the index is applied against the index.
The advantage of this method is that the data space is only accessed to retrieve records that satisfy the selection criteria applied against the index. Any selection not performed through this key selection method is performed using dynamic processing at the dataspace level.

Example

Consider the query
select * from FILE
where f1 = 'a' and f3 = 'b' and f4 = 'c'
order by f1
where FILE is a table with the fields F1, F2, F3, F4, F5 - all of type CHAR(5) - and a unique index FILE_1 over the fields F1, F2, F3, F4 exists.
This query will be implemented using the existing index FILE_1.
Key positioning (see Note for QQKP) is performed only on the leftmost key field of the index (QQI3 = 1 for QQRID = 3001).
On all index entries that match the selection criteria for F1, key selection is now perfromed meaning that the remaining selection criteria (f3 = 'b' and f4 = 'c') is applied against these selected index entries.

History
Last changed by/on SAP  20070813 
SAP Release Created in