From: Eric Wong Date: Sun, 10 May 2020 22:37:14 +0000 (+0000) Subject: msgmap: use TRUNCATE for journal_mode, for now X-Git-Tag: v1.6.0~504 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=78888d36fb80889f6b0f8ca6f26edda145c14238;p=public-inbox.git msgmap: use TRUNCATE for journal_mode, for now It avoids I/O on the directory itself, which could prolong the lifetime of the storage device. --- diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 9523752e..5fe14383 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -48,6 +48,10 @@ sub new_file { if ($writable) { create_tables($dbh); + + # TRUNCATE reduces I/O compared to the default (DELETE) + $dbh->do('PRAGMA journal_mode = TRUNCATE'); + $dbh->begin_work; $self->created_at(time) unless $self->created_at;