Re: fastest SQL?

On Thu, Mar 11, 2010 at 8:41 PM, Don Granaman
<DonGranaman@xxxxxxxxxxxxxxx> wrote:
> "select 1 from dual" can be improved upon!
>
> (Disclaimer: This is not my original work.  See "Dueling with dual"
> discussions from the distant past.)


You might wish to revisit since the invention of fast_dual - edited
output from 11g. The difference is primarily down to working out that
v_dual is a view.




SQL ID: 520mkxqpf15q8
Plan Hash: 1388734953
select 1
from
 dual


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.00          0          0          0           0
Execute  10000      0.01       0.12          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total    10001      0.01       0.12          0          0          0           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  FAST DUAL  (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)

********************************************************************************

SQL ID: 9mf7xkyqxtcms
Plan Hash: 3937404369
select 1
from
 v_dual


call     count       cpu    elapsed       disk      query    current        rows
------- ------  -------- ---------- ---------- ---------- ----------  ----------
Parse        1      0.00       0.03          0          0          0           0
Execute  10000      0.15       0.14          0          0          0           0
Fetch        0      0.00       0.00          0          0          0           0
------- ------  -------- ---------- ---------- ---------- ----------  ----------
total    10001      0.15       0.17          0          0          0           0

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS   (recursive depth: 1)

Rows     Row Source Operation
-------  ---------------------------------------------------
      0  FIXED TABLE FULL X$DUAL (cr=0 pr=0 pw=0 time=0 us cost=0 size=3 card=1)

********************************************************************************



-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info
--
http://www.freelists.org/webpage/oracle-l


Other related posts: