diff options
| author | Stanislav Ochotnický <stanislav@ochotnicky.com> | 2022-04-15 13:20:44 +0200 |
|---|---|---|
| committer | Stanislav Ochotnický <stanislav@ochotnicky.com> | 2022-04-15 13:26:13 +0200 |
| commit | dc2ede527904f7ce1bc90bbaefaf3e0ac37d6d0f (patch) | |
| tree | 939454e57ee34c661c5685edb0750da8e5691392 | |
| parent | 7237f490c36759c664b8c448b8f740d14464d998 (diff) | |
Update database compaction section in performance section
The original text was out of date. This update provides basic information about
using notmuch compact
| -rw-r--r-- | performance.mdwn | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/performance.mdwn b/performance.mdwn index 14f96a0..7f9f7dc 100644 --- a/performance.mdwn +++ b/performance.mdwn @@ -74,31 +74,17 @@ make regular backups of your notmuch database: ### Compact your database -In order to greatly reduce the size of your database, you should -compact it. Carl says "This functionality is not yet available in the -Xapian library interface or else I would probably make notmuch call it -after building the database." and Pieter "[compacting] will cause -writes to be a bit more expensive in the short term, but will -significantly reduce the db's size, which your SSD will surely -appreciate." +In order to greatly reduce the size of your database, you should compact it. +This can be easily achieved with `notmuch compact`: -This needs xapian 1.2 - -Backup your database: - - $ cd - $ notmuch dump --output=notmuch-dump-b4compact - -Compact it: - - $ cd $(notmuch config get database.path)/.notmuch - $ xapian-compact --no-renumber xapian xapian-compacted - -Remove old and renamed compacted, if compacting went well: - - $ rm -R xapian - $ mv xapian-compacted xapian + $ notmuch compact +Note that this process can take a long time for large database and a write lock +will be held for the duration to ensure data integrity. The process will create +a new compacted database in a temporary directory and finally replace the +original database if compaction is successful. For added safety you can provide +`--backup=<directory>` option to preserve a copy of the original database. For +more details on this process see `notmuch-compact` man page. ### More information about this in the email archives: |
