Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Migrating to cost based optimizer

Re: Migrating to cost based optimizer

From: DA Morgan <damorgan_at_psoug.org>
Date: Sat, 23 Sep 2006 15:06:28 -0700
Message-ID: <1159049187.230216@bubbleator.drizzle.com>


hasta_l3_at_hotmail.com wrote:

> BTW, we have exactly zero experience with CBO :-)

Then let me make a recommendation.

Spend a lot of time learning how DBMS_STATS works. Be sure you check out the collection of system statistics, dictionary statistics, and how to fool Oracle into believing things about objects that are not true, today, but may well be true, tomorrow.

For example:
exec dbms_stats.set_table_stats(USER, 'EMP', numrows=>1000000, numblks=>100000);

exec dbms_stats.set_index_stats(USER, 'ix_emp_deptno', numrows=>1000000, numlblks=>10000, numdist=>10000);

exec dbms_stats.set_column_stats(USER, 'emp', 'deptno', distcnt=>10000);

exec dbms_stats.set_table_stats(USER, 'dept', numrows=>100, numblks=>100);

I can easily fool the CBO into believing scott.emp and scott.dept are large tables with creative cardinalities.

-- 
Daniel Morgan
University of Washington
Puget Sound Oracle Users Group
Received on Sat Sep 23 2006 - 17:06:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US