Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How to know which index is used during the execution of sql

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
sangiah

Active User


Joined: 10 Jun 2005
Posts: 63

PostPosted: Thu Jun 16, 2005 3:50 pm    Post subject: How to know which index is used during the execution of sql
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
References
dbaprasad

New User


Joined: 06 Jun 2005
Posts: 3
Location: pune

PostPosted: Fri Jun 17, 2005 2:25 pm    Post subject: Re: How to know which index is used during the execution of
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    Post subject: Re: How to know which index is used during the execution of
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1