Need to add a new Index - compile or rebind?

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Sulabh Sinha
Registered Member
Posts: 17
Joined: Tue Aug 20, 2013 10:44 am

Need to add a new Index - compile or rebind?

Post by Sulabh Sinha »

Hi,

For an existing DB2 Table of zOS, if we add a new index would it require to compile or rebind the existing programs?

Regards,
Sulabh
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Need to add a new Index - compile or rebind?

Post by Anuj Dhawan »

Unless I'm mistaken - you'd need both. If the index column is not used in any SELECT for a given program, you'd bind it get the proper access path, fwiw.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Sulabh Sinha
Registered Member
Posts: 17
Joined: Tue Aug 20, 2013 10:44 am

Re: Need to add a new Index - compile or rebind?

Post by Sulabh Sinha »

Ok, thanks Anuj.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Need to add a new Index - compile or rebind?

Post by enrico-sorichetti »

adding an index is transparent to the application program...

a rebind is more than enough
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Sulabh Sinha
Registered Member
Posts: 17
Joined: Tue Aug 20, 2013 10:44 am

Re: Need to add a new Index - compile or rebind?

Post by Sulabh Sinha »

I'm not sure enrico-sorichetti if I followed you, could you please restate that again.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Need to add a new Index - compile or rebind?

Post by enrico-sorichetti »

adding an index is transparent to the application program...
restated how requested :mrgreen:

quick and dirty explanation ...

when issuing a select on a table without indexes DB2 must do a FULL table scan to find out the rows
which satisfy the where condition of the select

if an index is defined on the relevant columns a FULL table scan is no longer needed ( generally )

so the APPLICATION PROGRAM is not aware of the optimisations implemented by the support group

to take advantage of the new performance option ( the index ) a bind is required
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”