Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Currval and buffer gets

RE: Currval and buffer gets

From: Jamadagni, Rajendra <Rajendra.Jamadagni_at_espn.com>
Date: Wed, 24 Apr 2002 05:38:35 -0800
Message-ID: <F001.0044DA3E.20020424053835@fatcity.com>


For this script I get following results on 8161 on DGUX

SQL> @1
run time using view x_$dual in centiseconds=1400 run time using table dual in centiseconds=2600



On 9012 on AIX I get
SQL> @1
run time using view x_$dual in centiseconds=600 run time using table dual in
centiseconds=900.000000000000000000000000000000000003


----------------------

On 8161 here is the output from tkprof for simple loop of assigning sysdate to a local variable.
DECLARE
    dummy date;
BEGIN
    FOR i IN 1..100000 LOOP

        dummy := SYSDATE;
    END LOOP;
END; call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ----------



Parse 1 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ----------

total 1 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0
Optimizer goal: RULE
Parsing user id: SYS



SELECT SYSDATE
FROM
 SYS.DUAL call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ----------



Parse 1 0.00 0.01 0 0 0 0
Execute 36646 5.85 5.62 0 0 0 0
Fetch 36646 3.60 3.17 0 36646 146584 36646
------- ------ -------- ---------- ---------- ---------- ----------

total 73293 9.45 8.80 0 36646 146584 36646

Misses in library cache during parse: 0
Optimizer goal: RULE
Parsing user id: SYS (recursive depth: 1)



For the same loop on 9012 I get following ...

DECLARE
    dummy date;
BEGIN
    FOR i IN 1..100000 LOOP

        dummy := SYSDATE;
    END LOOP;
END; call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ----------



Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.77 0.76 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ----------

total 2 0.78 0.76 0 0 0 1

This is not even when using x_$dual.
HTH
Raj



Rajendra Jamadagni MIS, ESPN Inc. Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art! -----Original Message-----
Sent: Tuesday, April 23, 2002 9:23 PM
To: Multiple recipients of list ORACLE-L

Thanks for the test.

I ran this test to compare the performance difference dealing with dual and x$dual:

declare
nn number;
ss1 date;
ss2 date;
begin
ss1 := sysdate;
for i in 1..100000 loop
select 2 into nn from sys.x_$dual;
end loop;
ss2 := sysdate;
dbms_output.put_line('run time using view x_$dual in centiseconds='||(ss2 - ss1 ) * 24 * 60 * 60 * 100);

---
ss1 := sysdate;
for i in 1..100000 loop
select 2 into nn from dual;
end loop;
ss2 := sysdate;
dbms_output.put_line('run time using table dual in centiseconds='||(ss2 -
ss1 ) * 24 * 60 * 60 * 100);
end;


-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jamadagni, Rajendra INET: Rajendra.Jamadagni_at_espn.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

Received on Wed Apr 24 2002 - 08:38:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US