From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 087F01FA0B for ; Sun, 10 May 2020 22:37:16 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/5] msgmap: use TRUNCATE for journal_mode, for now Date: Sun, 10 May 2020 22:37:14 +0000 Message-Id: <20200510223715.19254-5-e@yhbt.net> In-Reply-To: <20200510223715.19254-1-e@yhbt.net> References: <20200510223715.19254-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 9523752e9af..5fe14383ac4 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;