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: Mark D Powell <Mark.Powell_at_eds.com>
Date: 30 Aug 2005 06:56:24 -0700
Message-ID: <1125410184.883403.219400@g49g2000cwa.googlegroups.com>


Uf, as David pointed out the Oracle version number is often important to the response.

The plan you presented looks as though it could be the optimal plan being indexed and nested looped based; however, in the absence of table and column statistics and without the actual SQL to look at it is impossible to say.

General rule
When you have a query plan you are uncertain of check the correctness of the statistics. Regenerate the statistics if necessary using a large sample size. Recheck the plan.

Look at the join order. If it does not appear to be the best order for the join to follow then rearrange the tables so that the table names follow the FROM clause in the order you think should be followed. Add an ORDEDERED hint and look at the plan to see if the CBO was able to follow the hint. Time test.

You can also try forcing a hash join instead of a nested loops join if one of the tables is an order of magnitude larger than the other.

Depending on your release and configuration choices several init.ora (spfile) parameters affect the CBO.

HTH -- Mark D Powell -- Received on Tue Aug 30 2005 - 08:56:24 CDT

Original text of this message

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