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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Collect Stats

Status
Not open for further replies.

dpafumi

Technical User
Oct 10, 2013
2
US
Hi to all,

I need some assistance on this issue. We are running 11g (11.2.0.3)
We have a "working table" that is empty at the beginning of the day.
Then we start adding rows (insert) with a key column called STATE with a value of 100.
At the same time, there are other apps that pickup data in state 100 , process that data and change that state to 200 or 300.
There is also another app that pickup data in state 200 , process that data and change that state to 300 or 400.

So in summary, the data on that table is at the beginning empty, then all the rows are in state 100, they slowly move to different states (200, 300, etc) and by the end of the day, they are all in 400.

My question is what would be the best way to collect stats on this table?

I was thinking to create an hourly job to collect stats on that table:
exec dbms_stats.gather_table_stats (
ownname => 'SCOTT',
tabname => 'WORK_TABLE',
estimate_percent => dbms_stats.auto_sample_size,
degree => 3,
cascade => true );

Any suggestions? Should we cancel the Oracle Standard jobs executed at 10 PM?

Thanks!!
 
I think the general answer is going to be "it depends".

For starters, how many rows do you typically get in the table in a day? And what kind of queries are you running against it - do they tend to be full table scans or are you using an index? When the other jobs are updating, how are they pulling the data (multirow cursor or a single row), and are they updating one row at a time or in a batch? To empty it at the end of the day, do you delete rows or truncate the table?

These are just a few factors that come to mind offhand that would indicate whether or not collecting stats is even going to buy you anything.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top