Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to optimize query's execution?
uf wrote:
> > Based on the plan above the tables are not analyzed and the "rule"
> > optimizer is being used, not the "cost" one. Analyze the tables and try
> > again.
> >
> > execute dbms_stats.gather_table_stats(user,'MY_KEYS')
> > execute dbms_stats.gather_table_stats(user,'MY_JSTATE')
>
> OK, I will try that. How about ANALYZE TABLE <table> ESTIMATE STATISTICS
> SAMPLE 100 PERCENT; ?
>
> This should create some statistics, otherwise cost-based approach to
> optimization will not work, I believe.
You SHOULD be using the dbms_stats procedure. Analyze table is provided for backward comopatibility; dbms_Stats computes more comprehensive statistics necessary for the CBO.
David Fitzjarrell Received on Thu Sep 01 2005 - 09:25:49 CDT