Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need information about DBMS_STATS.GATHER_TABLE_STATS ()

 
vijay jamadade
Ranch Hand
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 243
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it. Many Thanks Martin.



Vijay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic