Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us