View previous topic :: View next topic
|
Author |
Message |
venkatm99
New User
Joined: 01 Jun 2006 Posts: 23 Location: Sinagpore
|
|
|
|
hi
A table is having 3 index.
index-1 - unique (primary key)
index-2
index-3
Iam expecting my program to select index-2 but it is selecting index-1.
Hw index is priortised??????
cheers
venkat |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
|
|
Can you put SQL statement your program is using.
Normally DB2 uses most optimized way to get data, normally!!
Also make sure in SQL statement columns in index-2 are first.
You can also use SQLEASE untility to find how Db2 is going to filter based on indexes and what indexes it may use. |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
|
|
Quote: |
Also make sure in SQL statement columns in index-2 are first.
|
meant to be:
Also make sure in SQL statement columns in index-2 are first in WHERE clause. |
|
Back to top |
|
|
|