That makes sense! Since this is a sub-routine and it gets called multiple times from the main body (please see example below), would it make sense for me to do the prepare on the main body and just execute in the sub-routine? Did I understand your advice correctly?
if (($message[6] eq "ASA-6-302015") || ($message[6] eq "ASA-6-302013") +) { $Config_found = 1; $Accepted++; $Action="Allow"; # $Scountry = &Obtain_GeoIP ($message[14]); my $sqlinsert = $dbh->prepare("insert into `$Table_Name` ( Mon +th, Day, Time, Host, ASA_ID, Protocol, Source_Segment, Source_IP, Sou +rce_Port, Source_NAT_IP, Source_NAT_PORT, Source_DNS, Source_GeoIP, S +ource_Domain, Destination_Segment, Destination_IP, Destination_Port, +Destination_NAT_IP, Destination_NAT_Port, Destination_DNS, Destinatio +n_GeoIP, Destination_Domain, Action, Severity, Notes, Full_message ) +values ( '$message[0]', '$message[1]', '$time', '$message[5]', '$mess +age[6]', '$message[9]', '$message[13]', '$message[14]','$message[15]' +,'$message[16]','$message[17]', '$Sdns', '$Scountry', '$Sdomain', '$m +essage[19]', '$message[20]', '$message[21]', '$message[22]', '$messag +e[23]', '$Ddns', '$Dcountry', '$Ddomain', '$Action', '$severity', '$n +otes', '$original_line' )"); $sqlinsert->execute(); next; }

In reply to Re^4: Slow response on DBI MySQL query by Fortificus
in thread Slow response on DBI MySQL query by Fortificus

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.