]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Msgmap.pm
msgmap: use TRUNCATE for journal_mode, for now
[public-inbox.git] / lib / PublicInbox / Msgmap.pm
index 8aaa06b268f7e1d90ce6c2f583752b7677c846ab..5fe14383ac484a79e1b279b718e28db68b5449d4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # bidirectional Message-ID <-> Article Number mapping for the NNTP
@@ -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;