File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes need information about DBMS_STATS.GATHER_TABLE_STATS () Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "need information about DBMS_STATS.GATHER_TABLE_STATS ()" Watch "need information about DBMS_STATS.GATHER_TABLE_STATS ()" New topic
Author

need information about DBMS_STATS.GATHER_TABLE_STATS ()

vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 240
I am using DBMS_STATS.GATHER_TABLE_STATS () function to analyze tables. Currently i am executing these once new data is loaded. I wanted to know when these user defined statistics expire? After how much time i need to run DBMS_STATS.GATHER_TABLE_STATS () command on my tables?


Thanks,
Vijay


Regards, Vijay Jamadade.
( Nothing is Impossible.)
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

The statistics never expire. They may become stale (inaccurate) due to modifications that happen to the table after the statistics were gathered. So if your table doesn't ever change after loading data, you don't need to update its statistics at all. If it changes a lot, you may need to update statistics quite often.

There is an automatic mode for gathering statistics from Oracle 10g onward (or so), it gathers the stats when more than some fraction (10%, I believe) of table rows change.

I'd suggest reading Oracle documentation on statistics, you might start here (if you're not on 11g, find documentation for the version you're using).
vijay jamadade
Ranch Hand

Joined: May 12, 2008
Posts: 240
Got it. Many Thanks Martin.



Vijay
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: need information about DBMS_STATS.GATHER_TABLE_STATS ()
 
Similar Threads
SQLGrammarException
Making a "deleteAll()" for an entity bean
Simple RDBMS question
Table Design using Absolure or Relative
Oracle merge same table