View previous topic :: View next topic |
Author |
Message |
Rajat Beginner
Joined: 17 Dec 2003 Posts: 1 Topics: 1
|
Posted: Wed Dec 17, 2003 9:27 am Post subject: Index column in Plan table |
|
|
Hi there!,
Suppose, I have a table ABC with index INDX1 defined on three of its columns COL1, COL2 and COL3.
And there is a query with COL1, COL2 AND COL3 in its WHERE clause.
After doing an EXPLAIN of this query I found in PLAN TABLE that the DB2 accesstype is I and MATCHCOLS = 1.
Is there any way to know that which of the columns of the index INDX1, DB2 is referring to?
Thanks. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 17, 2003 10:39 am Post subject: |
|
|
Rajat,
If the column ACCESSTYPE in the plan table has a value of I, then DB2 uses an index to access the table named in column TNAME. The columns ACCESSCREATOR and ACCESSNAME identify the index.
If MATCHCOLS is greater than 0, the access method is called a matching index scan: the query uses predicates that match the index columns.
If MATCHCOLS is less than the number of index key columns, it indicates that index screening is possible.
Hope this helps...
cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Thu Mar 04, 2004 1:00 am Post subject: |
|
|
If you look in a higher post, there is a link posted which describes EXPLAIN results. |
|
Back to top |
|
|
|
|