]> Sergey Matveev's repositories - public-inbox.git/commitdiff
sharedkv: do not set cache_size by default
authorEric Wong <e@80x24.org>
Mon, 1 Feb 2021 08:28:28 +0000 (22:28 -1000)
committerEric Wong <e@80x24.org>
Mon, 1 Feb 2021 11:38:22 +0000 (11:38 +0000)
These DBs will probably be too small to be worth increasing the
cache size of.

lib/PublicInbox/SharedKV.pm

index b0588060435aae9525c6480b029d12f49b059988..d65c315813c193fe49582937654ed6dfb3458eb9 100644 (file)
@@ -27,7 +27,9 @@ sub dbh {
                });
                my $opt = $self->{opt} // {};
                $dbh->do('PRAGMA synchronous = OFF') if !$opt->{fsync};
-               $dbh->do('PRAGMA cache_size = '.($opt->{cache_size} || 80000));
+               if (my $s = $opt->{cache_size}) {
+                       $dbh->do("PRAGMA cache_size = $s");
+               }
                $dbh->do('PRAGMA journal_mode = '.
                                ($opt->{journal_mode} // 'WAL'));
                $dbh->do(<<'');