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

In reply to Re: performance problem with oracle dbd by etcshadow
in thread performance problem with oracle dbd by tito

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.