Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
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    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

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us