Page 1 of 1

Need to add a new Index - compile or rebind?

Posted: Sat Sep 14, 2013 7:58 pm
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

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

Posted: Sat Oct 19, 2013 4:04 pm
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.

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

Posted: Fri Jun 20, 2014 4:38 pm
by Sulabh Sinha
Ok, thanks Anuj.

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

Posted: Fri Jun 20, 2014 5:35 pm
by enrico-sorichetti
adding an index is transparent to the application program...

a rebind is more than enough

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

Posted: Fri Jun 20, 2014 10:28 pm
by Sulabh Sinha
I'm not sure enrico-sorichetti if I followed you, could you please restate that again.

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

Posted: Sat Jun 21, 2014 6:51 pm
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