]> git.notmuchmail.org Git - notmuch/commit
lib/n_d_remove_message: do not remove unique filename
authorDavid Bremner <david@tethera.net>
Thu, 20 Jul 2023 12:08:01 +0000 (09:08 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 22 Jul 2023 10:15:59 +0000 (07:15 -0300)
commitb6f144abe1f5aa3519240cf52f4cb9907fefcd0e
tree6d6c9b91b114a8b5e062651b870bf89c0733fc9d
parentd93d49b6aed5b3f71651ffe79225da08c7d8f1aa
lib/n_d_remove_message: do not remove unique filename

It is wasteful to remove a filename term when the whole message
document is about to be removed from the database. Profiling with perf
shows this takes a significant portion of the time when cleaning up
removed files in the database.

The logic of n_d_remove_message becomes a bit more convoluted here in
order to make the change minimal.

It is possible that this function can be further optimized, since the
expansion of filename terms into filenames is probably not needed
here.
lib/database.cc