If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > runstats without reorg

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-04-08, 08:21
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
runstats without reorg

I am using LUW 9.1 and have the following question.

What are the disadvantages (if any) if one runs runstats without reorg after considerable inserts/updates/deletes?
__________________

You are the creator of your own destiny!
Reply With Quote
  #2 (permalink)  
Old 04-04-08, 08:37
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
If you don't have many delete/update operations that would cause fragmentation on page level, you may not need a REORG. Have a look at the REORGCHK utility to see which rules are applied there.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 04-04-08, 08:43
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
Quote:
Originally Posted by stolze
If you don't have many delete/update operations that would cause fragmentation on page level, you may not need a REORG. Have a look at the REORGCHK utility to see which rules are applied there.
OK.

What if REORGCHK utility suggest that the table is to be REORGed but we go ahead and do RUNSTATS?

What are the implications (doing constant RUNSTATS eventhough the REORGCHK suggests that the table has to be REORGed)?
__________________

You are the creator of your own destiny!

Last edited by db2guru1; 04-04-08 at 09:19.
Reply With Quote
  #4 (permalink)  
Old 04-04-08, 09:40
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I really don't understand your question. RUNSTATS and REORG are two utilities for two completely different tasks. One does not and cannot replace the other. RUNSTATS collects statistics, the latter modifies the organization of the data on the data pages. Of course, the statistics depend on the current organization.

Since REORGCHK also does a RUNSTATS under the covers, the net result of not doing a REORG but a RUNSTATS instead would be pretty much zero, zip, nada.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #5 (permalink)  
Old 04-04-08, 10:11
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
I did not articulate my question properly.

I meant to say REORGCHK CURRENT STATISTICS (which does not do RUNSTATS under the cover)....

Let me formulate my question in another way....

"It is my understanding that if you do RUNSTATS on a table that is highly disorganized and fragmanted, db2 sometimes will not use the indexes"

Is the above statement correct?
__________________

You are the creator of your own destiny!
Reply With Quote
  #6 (permalink)  
Old 04-04-08, 10:17
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
If you don't have current statistics, DB2 may not choose the optimal access plan. Whether index access is the best access or not is a different question to be decided on a query-by-query basis.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #7 (permalink)  
Old 04-04-08, 10:21
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
That is EXACTLY what I want to hear.

Thanks much for your reply.
__________________

You are the creator of your own destiny!
Reply With Quote
  #8 (permalink)  
Old 04-04-08, 11:30
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
If you run reorgcheck using current stats, it might not produce corret results for the reorg. If you have done many updates your best bet is to run with UPDATE Statistics to make sure that reorgcheck utility has the right information to go on.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #9 (permalink)  
Old 04-04-08, 11:30
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
If you run reorgcheck using current stats, it might not produce corret results for the reorg. If you have done many updates your best bet is to run with UPDATE Statistics to make sure that reorgcheck utility has the right information to go on.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #10 (permalink)  
Old 04-04-08, 13:51
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
You need to

1. REORG
2. RUNSTATS
3. BIND/REBIND
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #11 (permalink)  
Old 04-04-08, 14:19
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
Brett, what good is a reorg, wiht out current stats if you have been doing major data movement?

Edit: do you mean an actual reorg or just a check?
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #12 (permalink)  
Old 04-04-08, 14:23
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
Quote:
Originally Posted by db2guru1
What are the disadvantages (if any) if one runs runstats without reorg after considerable inserts/updates/deletes?
Let's say that the *advantage* of doing runstats (without reorg) as compared with none of the two, that the subsequent access paths will be more adapted to the current (disorganized) state of the tablespace, i.e., more performant.
__________________
--_Peter Vanroose,
__IBM Certified Database Administrator, DB2 9 for z/OS
__IBM Certified Application Developer
__ABIS Training and Consulting
__http://www.abis.be/
Reply With Quote
  #13 (permalink)  
Old 04-04-08, 15:16
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Quote:
Originally Posted by Cougar8000
Brett, what good is a reorg, wiht out current stats if you have been doing major data movement?

Edit: do you mean an actual reorg or just a check?
Huh?

Don't you want the stats AFTER the Reorg?

And then REBIND the sprocs so they can use the new stats?
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #14 (permalink)  
Old 04-04-08, 15:57
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
are you doing an actual reorg or reorgcheck? If you are doing an actual reorg then you are correct, you want to follow up with stats. However, if you are doing a reorgcheck, then stats have to be done first(i.e. part of the reorgcheck utility).
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #15 (permalink)  
Old 04-04-08, 16:17
db2guru1 db2guru1 is offline
Registered User
 
Join Date: Aug 2003
Posts: 106
I am fully aware that you need to reorg, runstat, rebind etc....

I think you are missing my point.

My question is very simple....

"What happens if I repeatedly do RUNSTATS (without first doing reorg) - assume that the table warrants reorg"
__________________

You are the creator of your own destiny!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On