Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I reorg freshly built DB tables?

Status
Not open for further replies.

tbtcust

Programmer
Oct 26, 2004
214
US
Hi all.

We are loading freshly built DB tables. When I'm done, is a reorg/maintainance required?

Will not doing this cause perfomance lags?

My colleague said not needed. Performance will not suffer. I say we should run the reorg, runstats, rebind and commands.

Thanks in advance for any help.
 
How are you loading ? Inserting, or Inserting/Updating/Deleting during the LOAD process ???

BTW, which platform are you on ?

On DB2 LUW, you may run the REORGCHK command to get recommendation ..

Sathyaram

For db2 resoruces visit More DB2 questions answered at &
 
Thanks for replying sathyarams.

We are using the DB2 load utility. Platform is DB2 8 on Linux
 
Did your colleague why it's not needed? I don't have much experience in this area, but I would have thought the same thing as you, tbt.
 
tbt,

I think that if the table is relatively small, then performance may not be affected by runstats etc.

But, the general practice is that after a load this is performed in order to update the stats etc. to DB2.

I think I would run them as a matter of course.

Marc
 
Thanks everyone for your response.

We rebuilt the DB a few time. As part of the rebuild we ran some canned straight SQL. Sometimes after the runstats and sometimes with no runstats.

We constantly got better performance each time after the runstats. I just wish I had a clear picture as to why.

Thanks again.
 
REbuilding the DB would not be very beneficial for the optimizer. It would cure defragmentation, but you would still need info on - for instance - cardinalities - for the optimizer to perform optimal.

If you make the effort to measure performance then make sure to investigate using explain plan in each case and compare

Ties Blom

 
Will do blom0344. I had forgotten about using an explain.
 
You only need to reorg tables if there has been a lot of update/delete activity associated with it. i.e. if you've just loaded new tables, you shouldn't need to. You do need to run "runstats", however. This provides the DB2 optimiser with knowledge about each table, so that it can pick the best query plan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top