IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Program to select index-2 but it is selecting index-1


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkatm99

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Mon Nov 13, 2006 4:32 pm
Reply with quote

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
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Mon Nov 13, 2006 9:42 pm
Reply with quote

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
View user's profile Send private message
MFRASHEED

Active User


Joined: 14 Jun 2005
Posts: 186
Location: USA

PostPosted: Mon Nov 13, 2006 9:44 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top