From 78888d36fb80889f6b0f8ca6f26edda145c14238 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 May 2020 22:37:14 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/Msgmap.pm | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.44.0