Home » RDBMS Server » Server Administration » table analyze issue (11.2.0.1.0 Windos XP)
table analyze issue [message #522035] Tue, 06 September 2011 00:39 Go to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
Dear all,
The rows of table tb_hxl_list is 100,000,and set the parameters Estimate_Percent to 2 ,after analyzed,the sample_size is 4939,how do oracle to calculate?


SQL> Select Count(1)
  2  From hxl.TB_HXL_LIST;
 
  COUNT(1)
----------
    100000
 
SQL> show user;
USER is "HXL"
SQL> Begin
  2    Dbms_Stats.Delete_Schema_Stats(Ownname => 'HXL');
  3  End;
  4  / 
 
PL/SQL procedure successfully completed.
 
SQL> Begin
  2    Dbms_Stats.Gather_Schema_Stats(Ownname          => 'HXL',
  3                                   Estimate_Percent => 2,
  4                                   Method_Opt       => 'for all indexed columns',
  5                                   Degree           => 2,
  6                                   Cascade => True);
  7  End;
  8  / 
 
PL/SQL procedure successfully completed.
 
SQL> Select a.num_rows,a.sample_size
  2  From Dba_Tables a
  3  Where  a.table_name In ('TB_HXL_LIST');
 
NUM_ROWS SAMPLE_SIZE
-------- -----------
   99521        4939


Re: table analyze issue [message #522036 is a reply to message #522035] Tue, 06 September 2011 00:59 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
The key word is "estimate".
Oracle gives you the statistics it estimated from 4939 rows.

Regards
Michel
Re: table analyze issue [message #522039 is a reply to message #522036] Tue, 06 September 2011 01:08 Go to previous messageGo to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
hi,
How to set the Estimate_Percent when analyze table, are there some suggestions?
Re: table analyze issue [message #522042 is a reply to message #522039] Tue, 06 September 2011 01:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
No.
You have to estimate yourself between the time you want to use and the accuracy of the statistics you want to have... or let Oracle makes the decision by itself and let its standard job do the work for you.
Is there any reason you don't use the standard job?

Regards
Michel
Re: table analyze issue [message #522045 is a reply to message #522042] Tue, 06 September 2011 01:41 Go to previous messageGo to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
hi,
The standard job is run for a long time and impact the user application,so i disable it.
Re: table analyze issue [message #522055 is a reply to message #522045] Tue, 06 September 2011 03:51 Go to previous message
cookiemonster
Messages: 13959
Registered: September 2008
Location: Rainy Manchester
Senior Member
Well unless you what dodgy statistics you're going to have to replicate everything the job was doing. Have you considered moving the time it runs at instead?
Previous Topic: need to split a partition into multiple partitions
Next Topic: "Oracle tablespace management", "extent management" and "segment space mana
Goto Forum:
  


Current Time: Fri Nov 29 04:30:53 CST 2024