Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Program to select index-2 but it is selecting index-1
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    Post subject: Re: Program to select index-2 but it is selecting index-1
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    Post subject: Re: Program to select index-2 but it is selecting index-1
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us