I have been tweaking some code I have to minimize the time in which it runs.. I am currently doing about 2200 inserts in 53 seconds and I don't know if I am using the best DBI method to do it. I am currently using "do" but was wondering if preparing the statement once and then executing it would help out.
my query looks like this (real variable names taken out for readability)
For the 2253 entries there are 807 distinct alarm_time, 30 distinct source, 1 distinct trapd_server, and the alarms are pretty varied.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
my query looks like this (real variable names taken out for readability)
Code:
$query2 = "insert into trapd_statistics (alarm_time, source, trapd_server, real_alarm, logonly_alarm, unknown_alarm) values ('$var1', '$var2', '$var3', '$var4', '$var5', '$var6')";
$dbh->do($query2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;