Return-Path: <root@fatcity.cts.com>
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by naude.co.za (8.11.2/8.11.2) with SMTP id g571rvg04782
 for <oracle-l@naude.co.za>; Thu, 6 Jun 2002 21:53:57 -0400
Received: from fatcity.UUCP (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id KAA54991;
 Thu, 6 Jun 2002 10:41:14 -0700 (PDT)
Received: by fatcity.com (26-Feb-2001/v1.0g-b71/bab) via UUCP id 004766E9; Thu, 06 Jun 2002 10:13:23 -0800
Message-ID: <F001.004766E9.20020606101323@fatcity.com>
Date: Thu, 06 Jun 2002 10:13:23 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: "Mercadante, Thomas F" <NDATFM@labor.state.ny.us>
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: "Mercadante, Thomas F" <NDATFM@labor.state.ny.us>
Subject: RE: Database link performance 
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 71; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: multipart/alternative;	boundary="----_=_NextPart_001_01C20D7C.9E9FD198"
------_=_NextPart_001_01C20D7C.9E9FD198
Content-Type: text/plain

Mike,
 
you created the view on the db_B machine and called it from db_A, right?
 
 
"To Tom Mercadante: creating of a view, that does filtering, did not help.
Absolutely the same results!"
 

Tom Mercadante 
Oracle Certified Professional 

-----Original Message-----
Sent: Thursday, June 06, 2002 12:03 PM
To: Multiple recipients of list ORACLE-L



Hi, all!

 

Thanks for your help and suggestions.  Here is some feedback on what I have
found on  the performance problem of the querying data between two databases
using DB links.

 

To John Kanagaraj: filter by ROWNUM does not make any difference - I have
absolutely the same speed, when querying table with 5000 rows and filtering
'where ROWNUM <5000'.

 

To Tom Mercadante: creating of a view, that does filtering, did not help.
Absolutely the same results!

 

Just remind you the case:

declare 

   v_record B%rowtype;

 

   cursor cB

   is

   select *

   from B@db_B.mycomp.com

   where rownum < 5000;

begin

   for c in cB

   loop

     v_record :=c;

   end loop;

end;

 

My next step has been to analyze session-level statistics.

 

When using link we have physically two sessions - from a client to db_A
(opened explicitly) and from db_A to db_B (opened by Oracle automatically).
After execution of a script: 
- in the session to db_A we have 10000 SQL*Net roundtrips to/from db_link

- in the session to db_B we have 10000 SQL*Net roundtrips to/from client.

 

But when I am running the same script directly (from client to db_B) - there
is only ONE SQL*Net roundtrip to/from the client.

 

I asked Paul Dorsey to check it out with Tom Kyte at yesterday's NYOUG
meeting.

 

Tom told us that Oracle 8.* does single record fetches when using database
links. In general, database links have been tuned to support database
replication. It means, that 'create table new_A as select ... from
table_A@db_B' runs quickly but querying from new_A is quite slow.

 

The remaining question: has anybody tried to use database links in Oracle9i?
Does the same single fetch limitation apply?

 

Thank you,

Michael Rosenblum

Dulcian Inc.


------_=_NextPart_001_01C20D7C.9E9FD198
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = 
"urn:schemas-microsoft-com:office:office"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 5.50.4912.300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff 
size=2>Mike,</FONT></SPAN></DIV>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff size=2>you 
created the view on the db_B machine and called it from db_A, 
right?</FONT></SPAN></DIV>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=175050117-06062002><FONT face=Arial color=#0000ff 
size=2>"T</FONT><FONT face=Arial><FONT color=#0000ff><FONT size=2>o Tom 
Mercadante: creating of a view, that does filtering, did not help. Absolutely 
the same results!<SPAN 
class=175050117-06062002>"</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<P><FONT face=Arial size=2>Tom Mercadante</FONT> <BR><FONT face=Arial 
size=2>Oracle Certified Professional</FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Michael Rosenblum 
  [mailto:mrosenblum@dulcian.com]<BR><B>Sent:</B> Thursday, June 06, 2002 12:03 
  PM<BR><B>To:</B> Multiple recipients of list ORACLE-L<BR><B>Subject:</B> Re: 
  Database link performance <BR><BR></FONT></DIV>
  <DIV>
  <DIV>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">Hi, all!<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p></o:p>&nbsp;</P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><SPAN 
  class=776004614-06062002>Thanks for your help and suggestions.&nbsp; Here is 
  some feedback on what I have found on </SPAN></o:p>&nbsp;the performance 
  problem of the querying data between t<SPAN class=776004614-06062002>w</SPAN>o 
  databases using DB links.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">To John Kanagaraj: filter by 
  ROWNUM does not make any difference &#8211; I have absolutely the same speed, when 
  querying table with 5000 rows and filtering &#8216;where ROWNUM 
  &lt;5000&#8217;.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">To Tom Mercadante: creating of 
  a view, that does filtering, did not help. Absolutely the same 
  results!<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><U>Just remind you the 
  case:<o:p></o:p></U></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">declare <o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>v_record 
  B%rowtype;<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;</SPAN><o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp; </SPAN><SPAN 
  style="mso-spacerun: yes">&nbsp;</SPAN>cursor cB<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>is<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>select *<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>from 
  B@db_B.mycomp.com<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>where rownum &lt; 
  5000;<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">begin<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>for c in cB<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>loop<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>v_record 
  :=c;<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN 
  style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN>end loop;<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">end;<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">My next step has been to 
  analyze session-level statistics.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">When using link we have 
  physically two sessions &#8211; from a client to db_A (opened explicitly) and from 
  db_A to db_B (opened by Oracle automatically). After execution of a script: 
  <BR>- in the session to db_A we have 10000 SQL*Net roundtrips to/from 
  db_link<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">- in the session to db_B we 
  have 10000 SQL*Net roundtrips to/from client.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">But when I am running the same 
  script directly (from client to db_B) &#8211; there is only ONE SQL*Net roundtrip 
  to/from the client.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">I asked Paul Dorsey to check it 
  out with Tom Kyte&nbsp;at yesterday&#8217;s NYOUG meeting.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">Tom told us that Oracle 8.* 
  does single record fetches when using database links. In general, database 
  links have been tuned to support database replication. It means, that &#8216;create 
  table new_A as select &#8230; from table_A@db_B&#8217; runs quickly but querying from 
  new_A is quite slow.<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">The remaining question: has 
  anybody tried to use database links in Oracle9i? Does the same single fetch 
  limitation apply?<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">Thank you,<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">Michael 
Rosenblum<o:p></o:p></P>
  <P class=MsoNormal style="MARGIN: 0in 0in 0pt">Dulcian 
  Inc.<o:p></o:p></P></DIV></DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C20D7C.9E9FD198--
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mercadante, Thomas F
  INET: NDATFM@labor.state.ny.us

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@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).

