DUAL 负担减轻
from OTN:
有的时候开发人员过多的从dual中"取数据"
会带来严重的性能问题
Oracle Database 10g: The Top 20 Features for DBAs
Use DUAL Freely
How many developers (and DBAs, too) do you think use this command often?
select USER into <some variable> from DUAL
Far too many, probably. Each call to the DUAL creates logical I/Os, which the database can do without. In some cases the call to DUAL is inevitable as in the line <somevariable> := USER. Because Oracle code treats DUAL as a special table, some ideas for tuning tables may not apply or be relevant.
Oracle Database 10g makes all that worry simply disappear: Because DUAL is a special table, the consistent gets are considerably reduced and the optimization plan is different as seen from the event 10046 trace.
set autotrace on
select user from dual;
In Oracle9i
============================
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT GOAL: CHOOSE
1 TABLE ACCESS (FULL) OF 'DUAL'
In 10g
============================
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: ALL_ROWS
0 FAST DUAL
|