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: How to optimize query's execution?

Re: How to optimize query's execution?

From: <fitzjarrell_at_cox.net>
Date: 1 Sep 2005 07:25:49 -0700
Message-ID: <1125584749.141445.290180@g49g2000cwa.googlegroups.com>

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

Original text of this message

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