photo-stats

statistics processor for the terminal
git clone https://git.clttr.info/photo-stats.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 6afd1659f5dd4d114a81f20544524f9d3ea4e885
parent 56449e6cc0d261bd5dbbbd5d6469ef3ef52550ef
Author: René Wagner <rwa@clttr.info>
Date:   Fri,  3 Sep 2021 21:55:42 +0200

disable AutoCommit on db population

This greatly improves write speed for the sqlite-db.

Diffstat:
Mphosta | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/phosta b/phosta @@ -162,7 +162,7 @@ sub populate !$opt_v or say "### Exiftool command: $cmd"; my @lines = `$cmd`; - my $dbh = DBI->connect($dsn, '', '', { RaiseError => 1 }) or die $DBI::errstr; + my $dbh = DBI->connect($dsn, '', '', { RaiseError => 1, AutoCommit => 0 }) or die $DBI::errstr; my $errorcount = 0; foreach (@lines) { @@ -193,6 +193,7 @@ sub populate VALUES ('$file', '$maker', '$model', '$lensmake', '$lens', '$fl', '$fl35', '$apert', '$exposuretime', '$iso', '$flash', '$datetimeoriginal')"; my $rv = $dbh->do($stmt) or $errorcount++; } + $dbh->commit(); $dbh->disconnect(); say sprintf('%5d', $errorcount). ' image files skipped due to errors'; say "Updated database $opt_D.";