From what info you've provided, the problem could be a network latency issue. If you are doing something like:
for (1..1000) {
$sth->execute();
}
then you are communicating with the server, over the network, 1000 times. Each communication could be composed of several packets. Even if you assume just one packet round trip per communication (although it is possibly more), and a pretty good round-trip time of 10ms, then that's 10 seconds worth of network time.
Compare that to doing the same with pl/sql: you only have one such communication with the server (to execute the pl/sql function, with the loop inside). Basically zero network time.
Additionally, with the way that oracle handles inserts, internally, there is not necessarily a whole heck of a lot of overhead (assuming that the table is pre-extended, and particularly if you're not inserting data into indexed columns). Thus, network back-and-forth time could be a considerable overhead. However, a 5x difference is a bit much, unless the network connecting the DBI machine and the oracle server has some considerable latency. One thing to check is simply the ping time between them.
------------
:Wq
Not an editor command: Wq
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|