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
 

 

Drop index in DB2 Table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
thunderstorm

New User


Joined: 23 Mar 2007
Posts: 35
Location: pune

PostPosted: Sat Aug 08, 2009 3:16 am    Post subject: Drop index in DB2 Table
Reply with quote

Hi,

Can anyone tell me that if i drop an index , do i need to do runstats and reorg ? Do i also need to recompile the programs which were using the index ? What would happen if i drop the index , do no do the runstats and reorg but donot recompile the program.

Waiting for the reply

Thanks !
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Aug 08, 2009 3:32 am    Post subject:
Reply with quote

Hello,

Quote:
What would happen if i drop the index , do no do the runstats and reorg but donot recompile the program
Any number of very bad things. . . If you want a list, run some experiments using tables/data no one else uses.

You should re-compile and rebind all of the programs that use the table. It is doubtful that you will know which queries may use that index.

You surely want to do runstats. You may or may not want to run a reorg. Suggest you do both. I am very big on problem/surprise avoidance. . . icon_cool.gif
Back to top
View user's profile Send private message
thunderstorm

New User


Joined: 23 Mar 2007
Posts: 35
Location: pune

PostPosted: Sat Aug 08, 2009 4:06 am    Post subject:
Reply with quote

[You should re-compile and rebind all of the programs that use the table. It is doubtful that you will know which queries may use that index.
]

I know which all programs use that index as i have explain reports. I have modified the program to avoid using that index. Actually , there is only 1 program which is using that index ( apparently this index is a secondary index ) and when the index was defined , the size of table was really small but now the size of the table is nearly 500 million times and any structure change causes a problem in the table as well as as Reorg also takes time.

so, is it fine if i recompile just the one program using that index ?[/quote]
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Aug 08, 2009 5:22 am    Post subject:
Reply with quote

Hello,

Quote:
so, is it fine if i recompile just the one program using that index
IMHO, no i believe it is not fine. . .

You might "get away" with taking the shortcut, but all i can mention is that it is better to get into the habit following a process that will always work rather than something to save a bit of time.

You really, really don't want to establish a pattern that routine maintenance becomes a new experience every time you make some change. . .

Again, only mho. . . icon_neutral.gif
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm


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