Query against DBA_EXTENTS slow after upgrade to 11.2.0.3 (Doc ID 1453425.1)

rongshiyuan發表於2014-05-19

Query against DBA_EXTENTS slow after upgrade to 11.2.0.3 (Doc ID 1453425.1)


In this Document

Symptoms
Changes
Cause
Solution
References


Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.3 and later
Information in this document applies to any platform.

Symptoms

Queries on DBA_EXTENTS are much slower due to the presence of a merge join cartesian.
This can also influence the performance of script used to collect upgrade/migrate diagnostics as per instructions in:

Document 556610.1 Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql) .

Running script  on version 11.2.0.1 prior to upgrade, there was no performance issue.
The following SQL query from dbupgdiag.sql may run slowly  (~2 hours) after applying patchset 11.2.0.3.

Prompt ===========================================
Prompt Tablespace and the owner of the aud$ table
Prompt ===========================================
select owner,tablespace_name from dba_extents where segment_name='AUD$' group by owner,tablespace_name;

 

Changes

An execution plan regression occurs if there are a large number of records in the X$KTFBUE table.  Gathering of dictionary or fixed object stats does not improve performance as this table is intentionally omitted from those packages.

Cause

The Cost Based Optimizer uses a cardinality estimate of 100,000 rows for this table, and the 11.2.0.3 execution plan is doing a full table scan. If you have a large number of extents, this query can take more than 1 hour to complete.
 There are a number of unpublished bugs open on slow perfomance for queries on DBA_EXTENTS
Specifically:

Bug 13542477: ON 11.2.0.3 QUERY DBA_EXTENTS IS SO SLOW
Bug 14221159: JOIN CARDINALITY INCORRECT CALCULATED AFTER FIX 11814428

Solution


Following are possible workarounds to improve the performance

  1. Gathering stats on the X$KTFBUE table using the following command:
    EXEC DBMS_STATS.GATHER_TABLE_STATS('SYS', 'X$KTFBUE');

    For more information on gathering fixed table statistics see:
    Document  798257.1 GATHER_FIXED_OBJECTS_STATS Considerations
     

    OR
  2. alter session set "_optimizer_cartesian_enabled" = false;

    OR
  3. alter session set "_smm_auto_cost_enabled" = false;

    OR
  4. Disable fix for unpublished Bug Bug 11814428: POOR CARDINALITY ESTIMATE FROM JOIN WITH A UNION-ALL VIEW:
    alter session set "_FIX_CONTROL" = "11814428:0";

       

References

NOTE:1360496.1 - HCKW-0003 - Poor Storage Clauses For Object(s)
NOTE:1360944.1 - HCKW-0008 - SEG$ entry has no UET$ entries (Dictionary managed)

NOTE:422730.1 - Query on dba_extents Slow on 10g
NOTE:556610.1 - Script to Collect DB Upgrade/Migrate Diagnostic Information (dbupgdiag.sql)





來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1164436/,如需轉載,請註明出處,否則將追究法律責任。

相關文章