| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which is faster, Insert(.... or Procedure(... that does Inserts?
The client-driven insert might be just a bit slower if you supply the values as literals (Oracle has to parse the SQL each time). Unless you have a very small amount of memory on the Oracle box OR you're talking about 1000's of inserts/second, you probably won't notice it.
You could use bind variables in the INSERT. That would make it pretty much equivalent to doing the insert in the SP. Either way, it's a single network roundtrip and a single parse.
If you were doing an insert, several updates, etc., at one shot, you WOULD see a difference in these two. That would be the difference of 1 NRT vs. several NRT's.
A soft advantage of the SP approach is that you have the data logic in a single place. Depending on your particular app, it might or might not be worth it. I usually favor SP's for at least that reason.
Regards,
Dave
Ken Sproule <kenmn_at_tds.net> wrote in message
news:vbg2dss3q1lrpf1ehvmk0s825cb2rp5bgp_at_4ax.com...
> Thanks to all in advance.
>
> The question involves calls from a C++ program using Microsoft's ADO.
>
> If you execute a command using ado that is a string like:
>
> "insert into TableA ( filed_1 , field_2 ) values( 1 , 2 );"
>
>
> Then execute a stored procedure like "call Procedure_A( 1 , 2 ) and
> let the
> stored procedure do the inserting like:
> psudo-code - Procedure_A( 1 , 2 ) {
> insert into TableA ( filed_1 , field_2 ) values( 1 , 2 );"
> }
>
> Which one is actually faster. Is the procedure faster because the
> access path is precompiled in?
>
> Best,
>
> Ken Sproule
> kenmn_at_tds.net
>
>
> Ken Sproule
> kenmn_at_tds.net
Received on Fri Mar 17 2000 - 00:00:00 CST
![]() |
![]() |