Re: A PL/SQL performance question

From: Steve M <steve.mcdaniels_at_vuinteractive.com>
Date: Mon, 12 Aug 2002 13:35:45 -0700
Message-ID: <aj964f$7l8$1_at_spiney.sierra.com>


Both of your examples would perform about the same.

I recommend using something like this:

    insert into a_local_table
    select * from remote_table_at_remove_link where ...     commit;
    process data in the local table.

--
try to avoid using a cursor (this is the slowest possible way)

cursor c1 is select * from remote_table_at_remote_link;
--
for c in c1 loop
....
end loop;


If the remote table is very large, you may have rollback problems.
Depending on your db version, the rollback space
used is probably at the remote site, something you probably cannot control.
By doing the insert into ... you will use
a rollback on your local site.


"Jusung Yang" <jusungyang_at_yahoo.com> wrote in message
news:42ffa8fa.0208061230.6ae2656d_at_posting.google.com...

> 2nd aproach is better. There are restrictions on what kind of data can
> be pulled over a db link. Not to mention the added network traffic.
>
>
> jshubo_at_yahoo.com (Jambo) wrote in message
news:<cd48a5b6.0208052054.478d2e22_at_posting.google.com>...
> > Database A can access B via database link db_link_B
> >
> > I want to access table table_B in B by using some PL/SQL
Procedure_example.
> >
> > (1) first approach, compile Procedure_example in A using
> >
> > BEGIN
> > select .......from table_B_at_db_link_B;
> > END
> >
> > and then execute Procedure_example in A;
> >
> > (2) second approach, compile Procedure_example in B using
> >
> > BEGIN
> > select .........from table_B;
> > END
> >
> > and then execute Procedure_example_at_db_link_B in A;
> >
> >
> > Can anyone compare this two approach in term of system performance?
Received on Mon Aug 12 2002 - 22:35:45 CEST

Original text of this message