]> git.ipfire.org Git - thirdparty/public-inbox.git/commit
*index: --split-shards to speeds initial indexing
authorEric Wong <e@80x24.org>
Wed, 8 Oct 2025 21:24:22 +0000 (21:24 +0000)
committerEric Wong <e@80x24.org>
Fri, 10 Oct 2025 01:12:58 +0000 (01:12 +0000)
commit699220cc05ecf0ad06b8f175b94253b708e43fa8
treefc50ba0f61a6fb289371c102c6d739c96510311f
parent622e8c8933c99f732ea229da2fa55dd92f732163
*index: --split-shards to speeds initial indexing

When indexing millions of messages, Xapian has a tendency to
slow down as each shard gets bigger.  --split-shards allows
Xapian to work on temporary shards (more akin to "epochs")
and uses xapian-compact(1) to commit the finalized changes
for readers.  The result is roughly 2x faster for millions
of messages.

The downside of this switch is temporary space use increases by
2-3x and incremental changes are not visible to readers until
all indexing is complete.   It has no useful effect on
--reindex, but --reindex is typically faster than initial
indexing anyways since space is already allocated.

It still takes days to create a new extindex of lore, but
fewer days than before.

Another beneficial side effect of this switch is it also
tends to reduce the effect of fragmentation for --cow users
on btrfs.
14 files changed:
Documentation/public-inbox-convert.pod
Documentation/public-inbox-extindex.pod
Documentation/public-inbox-index.pod
Documentation/public-inbox-xcpdb.pod
lib/PublicInbox/Admin.pm
lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/SearchIdx.pm
lib/PublicInbox/SearchIdxShard.pm
lib/PublicInbox/V2Writable.pm
lib/PublicInbox/Xapcmd.pm
script/public-inbox-convert
script/public-inbox-extindex
script/public-inbox-index
script/public-inbox-xcpdb