From 340b740e5caa8337b91b4f490ff60c1084931be6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 12 Oct 2021 22:44:58 +0000 Subject: index: optimize after all SQLite DB commits This covers v1 inboxes, as well. We also guard the execution since "PRAGMA optimize" was only introduced in SQLite 3.18.0 (2017-03-30) --- lib/PublicInbox/OverIdx.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/OverIdx.pm') diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index d6d706f7..9fdb26c0 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -434,6 +434,7 @@ sub commit_lazy { my ($self) = @_; delete $self->{txn} or return; $self->{dbh}->commit; + eval { $self->{dbh}->do('PRAGMA optimize') }; } sub begin_lazy { -- cgit v1.2.3-24-ge0c7