in reply to DBI: How to update 150K records efficiently
Likely to be a significant slowdown, is the SQL abstraction done by SQL::Abstract. By including this in the loop, you make SQL::Abstract work once for each record.
The solution would be to get back to basics by writing the SQL yourself.
$db->query("UPDATE myTable SET va = ?, vb = ? WHERE vc = ?", $val1, $v +al2, $val3);
By the way, you should not call your DBIx::Simple $dbh. This is the common name for DBI objects, and objects of classes that inherit from DBI. Using the name $dbh for DBIx::Simple objects is kind of confusing. I suggest calling it $db instead.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: DBI: How to update 150K records efficiently
by lihao (Monk) on Mar 31, 2008 at 15:13 UTC | |
by Juerd (Abbot) on Mar 31, 2008 at 15:22 UTC |
In Section
Seekers of Perl Wisdom