select /*+ dynamic_sampling(b 10) dynamic_sampling_est_cdn(b) gather_plan_statistics*/ count(*) from tvb b; SELECT * FROM TABLE(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST')); 注意dynamic sampling used for this statement (level=2) 显示的level 2不是真的! level 10在这里真的是LEVEL 10! EXPLAIN PLAN SET STATEMENT_ID = 'abc' FOR select count(*) from tvb ; SELECT * FROM TABLE(dbms_xplan.display('PLAN_TABLE','abc','ALL')); set linesize 200 pagesize 1400; select /* FINDSQLID */ SQL_ID,SQL_FULLTEXT from V$SQL
本文转自maclean_007 51CTO博客,原文链接:http://blog.51cto.com/maclean/1277697