IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to know which index is used during the execution of sql


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sangiah

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Thu Jun 16, 2005 3:50 pm
Reply with quote

How to know which index is used during the execution of sql
Back to top
View user's profile Send private message
dbaprasad

New User


Joined: 06 Jun 2005
Posts: 3
Location: pune

PostPosted: Fri Jun 17, 2005 2:25 pm
Reply with quote

issue EXPLAIN command,
Back to top
View user's profile Send private message
Smitha

New User


Joined: 20 Jun 2005
Posts: 5

PostPosted: Tue Jun 28, 2005 2:03 pm
Reply with quote

Hi,

During the execution of an SQL, if the WHERE clause contains any of the fields that is in the index, then it will use that particular index.

Suppose you have 2 indexes: X1: A,B
X2: Y,Z
Now your WHERE clause has the field B, then the first index will be used.

Indexes are used to improve the peformance of your query.

-Smitha.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Cobol file using index COBOL Programming 2
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Parallel Sysplex - subprogram execution CICS 7
No new posts Prod parallel execution on mainframe ... CICS 1
Search our Forums:

Back to Top