SQL 執行計劃案例1

itpremier發表於2010-10-16

RESOLVE METHOD:

CHECK EXECUTE PLAN:

SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);


1, CHECK IF THERE IS CARTESIAN .

2,CHECK TABLE STATISTICS.

3, IF USE PREDICT FILTER ON TABLE, THEN CHECK COLUMN STATISTICS .

4, UPDATE TABLE STATISTICS.

SQL> EXEC DBMS_STATS.DELETE_TABLE_STATS(USER, 'ORD_HIT_COMM')
  PL/SQL procedure successfully completed.
  SQL> EXEC DBMS_STATS.GATHER_TABLE_STATS(USER, 'ORD_HIT_COMM')
  PL/SQL procedure successfully completed.

5, CHECK STATISTICS.

SELECT COLUMN_NAME, NUM_DISTINCT, NUM_NULLS, DENSITY, NUM_BUCKETS
   FROM USER_TAB_COLUMNS
   WHERE TABLE_NAME = 'ORD_HIT_COMM'
   AND COLUMN_NAME = 'ENABLE_FLAG';

[@more@]

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

相關文章