projects
/
public-inbox.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ce52f3
)
msgmap: use TRUNCATE for journal_mode, for now
author
Eric Wong <e@yhbt.net>
Sun, 10 May 2020 22:37:14 +0000 (22:37 +0000)
committer
Eric 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
patch
|
blob
|
history
diff --git
a/lib/PublicInbox/Msgmap.pm
b/lib/PublicInbox/Msgmap.pm
index 9523752e9af07f8b973ac45d5a5aeda408801513..5fe14383ac484a79e1b279b718e28db68b5449d4 100644
(file)
--- 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;