Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Currval and buffer gets
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; Here is the results: run time using view x_$dual in centiseconds=1100.000000000000000000000000000000000002 run time using table dual in centiseconds=1799.999999999999999999999999999999999997 For 100,000 executions it took 11 sec using x$dual and took 18 sec using dual. Regards, Waleed -----Original Message----- mailto:lpetrov_at_yahoo.com] Sent: Tuesday, April 23, 2002 8:43 PM To: Multiple recipients of list ORACLE-L No, I couldn't duplicate this effect (8.1.7.0.0/Linux and 9.0.1.1.1/Win2k) - 1) first test 2 simultaneous sessions and then 2) second test 3 simultaneous sessions running. Regards Lyubomir Petrov --- "Khedr, Waleed" <Waleed.Khedr_at_FMR.COM> wrote:Received on Tue Apr 23 2002 - 20:23:19 CDT
> Never mess up with Oracle's memory:
>
> It seems that x$dual is not designed for concurrent
> access. When I try to
> run the code below in two simultaneous windows the
> first one comes back and
> the second crash (8173):
>
> 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 table dual in
> centiseconds='||(ss2 -
> ss1 ) * 24 * 60 * 60 * 100);
> end;
>
>
> If the x$dual gets replaced by dual it works fine.
>
> Can any one duplicate this?
>
>
> Thanks
>
>
> Waleed
>
>
>
> -----Original Message-----
> Sent: Tuesday, April 23, 2002 6:49 PM
> To: Multiple recipients of list ORACLE-L
>
>
> I am writing a paper on application efficiency and I
> have a number of simple
> tests in that paper that illustrates that in a very
> efficient application
> the
> switch to x$dual can make around a 70-80 percent
> improvent. But beaware: the
> test suite only accesses x$dual and not other tables
> so the impact is large
> and the application is written in the most efficient
> way. Running the same
> test but in a worse efficiency case. shows only a
> 2-3 percent gain ......
>
> Anjo.
>
>
> "Khedr, Waleed" wrote:
>
> > Can you guys tell me about all the overhead to
> resolve the view definition
> > to reach the magical X$dual table?
> >
> > Waleed
> >
> > -----Original Message-----
> > Sent: Tuesday, April 23, 2002 12:58 PM
> > To: Multiple recipients of list ORACLE-L
> >
> > Redefine the view to work on dual and pay the
> price !!!
> > Checked it on oracle 8.1.6 and 9.0.1.
> > I will take the risk that maybe in some future
> date this will not work
> > if it can save a lot of resources now.
> >
> > Yechiel Adar
> > Mehish
> >
> > ----- Original Message -----
> > To: Multiple recipients of list ORACLE-L
> <ORACLE-L_at_fatcity.com>
> > Sent: Tuesday, April 23, 2002 3:13 PM
> >
> > > what would you do if Oracle removed this x$dual
> or made it multiple row
> > > table in future upgrades?
> > >
> > > -----Original Message-----
> > > To: Multiple recipients of list ORACLE-L
> > > Sent: 4/23/02 4:08 AM
> > >
> > > Hello Gaja
> > >
> > > Thanks for the detailed info.
> > > I created a view and did grant to public.
> > > I did 10 selects and they did only 2 buffers
> get.
> > > BTW - describe on x$dual does not work but
> select * works.
> > >
> > > Yechiel Adar
> > > Mehish
> > >
> > > ----- Original Message -----
> > > To: Multiple recipients of list ORACLE-L
> <ORACLE-L_at_fatcity.com>
> > > Sent: Monday, April 22, 2002 8:15 PM
> > >
> > >
> > > > Hello Yechiel,
> > > >
> > > > X$DUAL is an Oracle-internal table "in the
> SGA" and
> > > > will not be shown in an ALL_OBJECTS listing.
> > > > Obviously, you need to be SYS to see this. You
> can do
> > > > a describe as SYS and you will see it. Which
> is the
> > > > reason why I recommended creating a view and a
> public
> > > > synonym on the view, so that the application
> may
> > > > reference it without any issues.
> > > >
> > > > Cheers,
> > > >
> > > > Gaja
> > > >
> > > > --- Yechiel Adar <adaryechiel_at_hotmail.com>
> wrote:
> > > > > Hello Gaja
> > > > >
> > > > > I could not find x$dual. Did select on
> all_objects
> > > > > got zip.
> > > > > Oracle 8.1.6.3.4 on NT.
> > > > >
> > > > > Yechiel Adar
> > > > > Mehish
> > > > >
> > > > > ----- Original Message -----
> > > > > To: Multiple recipients of list ORACLE-L
> > > > > <ORACLE-L_at_fatcity.com>
> > > > > Sent: Sunday, April 21, 2002 8:28 PM
> > > > >
> > > > >
> > > > > > Hi Yechiel,
> > > > > >
> > > > > > Any full-table-scan in Oracle 8i (or
> below)
> > > > > consumes 4
> > > > > > LIOs to the segment header. This number
> has
> > > > > reduced to
> > > > > > 2 in 9i. Given that the 1 row that you are
> going
> > > > > after
> > > > > > is in 1 data block, there is 1 LIO for the
> data
> > > > > block
> > > > > > itself, given you a total of 5 LIOs. You
> can
> > > > > verify
> > > > > > this by setting 10046 for the session and
> looking
> > > > > at
> > > > > > the trace output.
> > > > > >
> > > > > > The workaround is to reference x$dual in
> your
> > > > > > application. Alternatively, you can create
> a view
> > > > > on
> > > > > > x$dual, create a synonym for it and then
> go from
> > > > > > there. You will incur some I/O for the
> first
> > > > > access of
> > > > > > the query (with the synonym), but
> subsequent
> > > > > accesses
> > > > > > will incur 0 LIOs against x$dual.
> > > > > >
> > > > > > Cheers,
> > > > > >
> > > > > > Gaja
> > > > > > --- Yechiel Adar <adaryechiel_at_hotmail.com>
> wrote:
> > > > > > > I did two statspack snapshots, one hour
> and
> > > > > forty
> > > > > > > minutes apart.
> > > > > > > Then I generated a report and loaded it
> into
> > > > > > > oraperf.com.
> > > > > > > In the report I saw that the two SQL
> statements
> > > > > that
>
=== message truncated === __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more <http://games.yahoo.com/> http://games.yahoo.com/ -- Please see the official ORACLE-L FAQ: <http://www.orafaq.com> http://www.orafaq.com -- Author: Lyubomir Petrov INET: lpetrov_at_yahoo.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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Khedr, Waleed INET: Waleed.Khedr_at_FMR.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).