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.
Query in Db2 Index .
-
- Posts: 93
- Joined: Sat Oct 23, 2010 1:28 pm
- Skillset: JCL , COBOL, VSAM , CICS
- Referer: Through Google Search
- Location: Chennai, India
- Contact:
Re: Query in Db2 Index .
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
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
-
- Posts: 93
- Joined: Sat Oct 23, 2010 1:28 pm
- Skillset: JCL , COBOL, VSAM , CICS
- Referer: Through Google Search
- Location: Chennai, India
- Contact:
Re: Query in Db2 Index .
Hi Alexm,
Thanks.
Regard,
Gautham
Thanks.
Regard,
Gautham
-
- Similar Topics
- Replies
- Views
- Last post
-
- 7
- 11802
-
by AusZosGuy
View the latest post
Fri Sep 10, 2021 6:40 pm
-
- 0
- 2575
-
by JIMDOOEY
View the latest post
Tue Mar 01, 2022 8:48 am
-
- 1
- 2502
-
by enrico-sorichetti
View the latest post
Fri Apr 02, 2021 6:56 pm