Query in Db2 Index .



IBM's flagship relational database management system

Query in Db2 Index .

Postby gauthamnagpur18 » Sat Jun 06, 2015 7:59 am

Hi,

I have a query in Db2 index concept.

Lets say table XYZ has A to Z columns.

& let's assume table XYZ has two index.

First index is for A & B column.

Second index is for A,B,E column.

Query:

When my SQL query refers to this table XYZ, which index would be referred. Whether it depends on fields given on "Where clause" ?

Thanks in advance.
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times

Re: Query in Db2 Index .

 

Re: Query in Db2 Index .

Postby alexm » Wed Jun 17, 2015 12:25 am

Hi gauthamnagpur18

I think there's no definite answer to your question.

However, if you have a DB2 system available you can play around with, create a PLAN_TABLE, try using the SQL 'EXPLAIN' statement and query column ACCESSNAME in the PLAN_TABLE afterwards.

Also, a good starting point for further reading would be Investigating SQL performance by using EXPLAIN (if you're on DB2 for z/OS 10), or any other DB2 documentation that describes the conditions for a good access path selection, e.g. try this search over the IBM webpages

Best regards,
alexm
User avatar
alexm
 
Posts: 33
Joined: Wed Oct 13, 2010 6:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query in Db2 Index .

Postby gauthamnagpur18 » Wed Jun 17, 2015 12:51 am

Hi Alexm,

Thanks.

Regard,
Gautham
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post