Almost every Oracle professionals agrees that the old-fashioned sort_area_size and hash_area_size parameters imposed a cumbersome one-size-fits-all approach to sorting and hash joins. Different tasks require different RAM areas, and the trick has been to allow "enough" PGA RAM for sorting and hash joins without having any high-resource task "hog" all of the PGA, to the exclusion of other users. Oracle9i introduced the pga_aggregate_target parameters to fix this resource issue, and by-and-large, pga_aggregate_target works very well for most systems. You can check your overall PGA usage with the v$pga_target_advice advisory utility or a STATSPACK or AWR report. High values for multi-pass executions, high disk sorts, or low hash join invocation might indicate a low resource usage for PGA regions. Let's take a look at the issues surrounding the hidden limits of pga_aggregate_target. The limits of sorting and hashingMany Oracle professionals do not know the important limitations of pga_aggregate_target:
These restrictions were made to ensure that no large sorts or hash joins hog the PGA RAM area, but there are some secrets to optimizer the PGA. For example, the following set of parameters indicates that the Oracle DBA does not understand PGA management.
Let's take a closer look at expert tricks for advanced PGA management. Hidden parameters for Oracle PGA regionsWith proper understanding (and knowing that these undocumented parameters are not supported by Oracle), you can adjust your PGA regions to allow for system-specific sorting and hash joins.
We also see these additional undocumented parameters:
Super-size meFor certain Oracle applications the Oracle professional will want to allow individual tasks to exceed the default limits imposed by Oracle. For example, PC-based Oracle servers (1 or 2 CPU's with 8 gigabytes of RAM) will often have unused RAM available. For example, a fully-cached 5 gigabyte database on an 8 gigabyte dedicated Oracle server will have approximately 1 gigabyte available for the PGA (allowing 20% for the OS and other SGA regions):
While it is unusual for an online system to require super-sized regions for sorting (because the result sets for online screens are normally small), there can be a benefit to having large RAM regions available for the Oracle optimizer. The Oracle cost-based optimizer will determine whether a hash join would be beneficial over a nested-loop join, so making more PGA available for hash joins will not have any detrimental effect since the optimizer will only invoke a super-sized hash join if it is better than a nested-loop join. In a system like the example in Figure 1, the following settings would increase the default sizes for large sorts and hash joins.
With these hidden parameters set we see a 5x large size increase for parallel queries and sorts:
In conclusion, overriding the built-in safeguards of pga_aggregate_target can make more efficient use of RAM resources in cases where large RAM regions are available on the database server. When used with care (and the blessing of Oracle Technical Support) it can often make sense to over-ride these default values to make better use of expensive RAM resources. |
REFERENCES
Undocumented secrets for super-sizing your PGA by Don Burleson
No comments:
Post a Comment