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
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

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