Re: PGA_AGGREGATE_TARGET sizing of work areas and HJ cost

From: Jonathan Lewis <>
Date: Fri, 29 May 2009 18:45:16 +0100
Message-ID: <>

"joel garry" <> wrote in message On May 29, 9:14 am, Grzegorz <> wrote:
> Hi,
> I'm doing some investigations
> because of query plan changing in the same session (from NL Index RS to
> HJ FTS), and got question about Hash_Join_Area_Size when
> work_area_policy=auto.
> Is that possible that the same session can have different
> HJAS for same query ?
> When auto pga allocation is in place its quite possible in my opinion.
> Looks like depending on instance workload (in PGA terms) some queries
> may switch between NL Index RS and HJ FTS in the same session.
> I'm on .
> Regards.
> GG

I was under the impression that CBO used hash_area_size only when work_area_policy=manual.

Are you certain you are asking about the right parameter?

I'm thinking anything that can reparse the query could cause a change in plan, and there are many things that will cause invalidations leading to that. Also, if you are using parallel or shared servers other strange things can happen. The way to know for sure is to trace your session and look. Instant classic paper: Other interesting observations about PGA from this old chestnut: Earlier versions of 9.2 had many bizarre issues with auto PGA, it's possible that has idiosyncracies. Have you set session_cached_cursors, cursor_sharing, or do you see anything in the alert log or other evidence that too much is happening in your shared sql area?

In 11g you can flush a single query:

Assuming of course it isn't the obvious bind variable issue as John mentioned, in which case it really wouldn't be the "same query."



From the way the OP asks the question I don't think he had the parameter hash_area_size in mind; to me it sounded like a question about "how is the equivalent of the hash_area_size derived when using automatic workarea sizing".


Jonathan Lewis

Author: Cost Based Oracle: Fundamentals

The Co-operative Oracle Users' FAQ
Received on Fri May 29 2009 - 12:45:16 CDT

Original text of this message