Home » RDBMS Server » Server Administration » Collect Table Stats (11gr2 11.2.0.3)
Collect Table Stats [message #598135] Thu, 10 October 2013 10:26 Go to next message
Diego Pafumi
Messages: 12
Registered: July 2004
Junior Member
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!!
Re: Collect Table Stats [message #598136 is a reply to message #598135] Thu, 10 October 2013 10:29 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
what problem are you trying to solve?
How will you know when this problem has been solved?
Re: Collect Table Stats [message #598138 is a reply to message #598136] Thu, 10 October 2013 11:10 Go to previous messageGo to next message
Diego Pafumi
Messages: 12
Registered: July 2004
Junior Member
Hello,
The problem is with queries using that table:
select .... from WORK_TABLE where state = xxxx

They were slow. So I applied that logic of collecting stats hourly. I wonder if there is a better way to do that.
Re: Collect Table Stats [message #598139 is a reply to message #598135] Thu, 10 October 2013 11:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Do not collect any statistics, the only "static" statistic along the day is the number of rows, so set it (using SET_TABLE_STATS procedure) after loading the table. The number of blocks will likely never change so set it once for the table life duration.


Re: Collect Table Stats [message #598140 is a reply to message #598138] Thu, 10 October 2013 11:14 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
They were slow. So I applied that logic of collecting stats hourly.


This will be completely useless unless you have some index on the column and collect histogram on this column.

icon2.gif  Re: Collect Table Stats [message #598143 is a reply to message #598135] Thu, 10 October 2013 11:54 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Same question at: http://www.dba-village.com/village/dvp_forum.OpenThread?ThreadIdA=68643&SkipA=0

Re: Collect Table Stats [message #598145 is a reply to message #598143] Thu, 10 October 2013 11:56 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
DITTO
https://forums.oracle.com/thread/2591289
Previous Topic: ORA-01034: ORACLE not available ORA-27102
Next Topic: Materialized views
Goto Forum:
  


Current Time: Thu Mar 28 05:34:08 CDT 2024