]> Sergey Matveev's repositories - public-inbox.git/commitdiff
msgmap: use TRUNCATE for journal_mode, for now
authorEric Wong <e@yhbt.net>
Sun, 10 May 2020 22:37:14 +0000 (22:37 +0000)
committerEric Wong <e@yhbt.net>
Tue, 12 May 2020 06:16:03 +0000 (06:16 +0000)
It avoids I/O on the directory itself, which could prolong
the lifetime of the storage device.

lib/PublicInbox/Msgmap.pm

index 9523752e9af07f8b973ac45d5a5aeda408801513..5fe14383ac484a79e1b279b718e28db68b5449d4 100644 (file)
@@ -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;