in reply to Efficiency on Code
Because your not actually setting $TOTALLCLAIM anywhere in the loop! Are you using strict?for (1 .. $sth->do("COUNT SOMETHING")) { cleaner($TOTALLCLAIM); }
Anyway, assuming that 'ACCOUNT#' is an actual result column, you meant $TOALL instead of $TOTALLCLAIM, and you can write your SQL query so you only get that column from the DB (if you haven't done so already that will probably get you the biggest performance increase) - asking for an array will probably be slightly faster:
while (my ($accountno) = sth->fetchrow_array) { push @array_claim,$accountno; }
Usually you can gain the most performance in database related programs by carefully analyzing and (re)writing your queries and datamodel, though.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Efficiency on Code
by dragonchild (Archbishop) on Jan 06, 2005 at 19:12 UTC | |
|
Re^2: Efficiency on Code
by Anonymous Monk on Jan 06, 2005 at 19:15 UTC | |
by Joost (Canon) on Jan 06, 2005 at 19:32 UTC |