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 Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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