Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: Performance & Tuning >> CBO performance issue

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: CBO performance issue
 Glenn  Posted: Mar 01, 2008 07:19:14 AM

 Total Post: 2
 Joined: Jan, 2008






 Why do the Oracle CBO calculate the cost diffrent when I run this statment.
DBMS_STATS.GATHER_TABLE_STATS(
OWNNAME => 'APP01',
tabname => 'Table1',
ESTIMATE_PERCENT => 10 ,
block_sample => TRUE,
METHOD_OPT => 'FOR ALL COLUMNS SIZE AUTO',
CASCADE => TRUE,
GRANULARITY => 'ALL',
DEGREE => DBMS_STATS.DEFAULT_DEGREE

that should be equel to this ANALYEZED statment.
Analyze Table 'APP01.Table1' Estimate Statistics Sample 10 Percent';

I get a better execution plan with the ANALYEZED statment then DBMS_STATS.GATHER_TABLE_STATS.

Can someone try to explain this for me?

Oracle recomend you to use DBMS_STATS.GATHER_TABLE_STATS before ANALYZED.

Regards,
//Glenn

 Mohammed Taj
Posted: Mar 01, 2008 07:31:56 AM  

 Total Post: 634
 Joined: Jul, 2007






 
Analyze command is desupported and oracle only recommneded to use DBMS_STATS package to gather statistics.

analyze command give wrong statistics information.

regards
Taj

 Glenn
Posted: Mar 01, 2008 08:04:47 AM  

 Total Post: 2
 Joined: Jan, 2008






 
HI,

But why do I get a better execution plan on my SQL query with ANALYZE vs DBMS.STATS, this is biggest concern.

//Glenn

 Mohammed Taj
Posted: Mar 01, 2008 08:46:51 AM  

 Total Post: 634
 Joined: Jul, 2007






 
... I get a better execution plan on my SQL query with ANALYZE ...
This is not better, this is wrong execution plan which you get from ANALYZE command.



 MOH_DBA
Posted: Mar 11, 2008 06:14:32 PM  

 Total Post: 80
 Joined: Nov, 2007






 
Analyze and dbms_stats have defferent woking methods, capabalities and pupuses, this is an overview of that:

http://www.idevelopment.info/data/DBA_tips/Tuning/TUNING_17.shtml#AnalyzevsDBMS_STATS

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Mohammed Taj634
  Murtuja Khokhar588
  Jayanta Sur479
  Vigyan Kaushik385
  Ramesh Jois226
  neeraj sharma189
  snehalatha p166
  Gitesh Trivedi157
  Gopu Gopi149
  Kushal ratnaker136






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software