From 567bcbc294b3aed632d18eb22056840292bdeb1e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 6 Nov 2011 12:17:36 -0500 Subject: Store "from" and "subject" headers in the database. This is a rebase and cleanup of Istvan Marko's patch from id:m3pqnj2j7a.fsf@zsu.kismala.com Search retrieves these headers for every message in the search results. Previously, this required opening and parsing every message file. Storing them directly in the database significantly reduces IO and computation, speeding up search by between 50% and 10X. Taking full advantage of this requires a database rebuild, but it will fall back to the old behavior for messages that do not have headers stored in the database. --- lib/database.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/database.cc') diff --git a/lib/database.cc b/lib/database.cc index fa632f8..e4ef14e 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1725,7 +1725,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch, goto DONE; date = notmuch_message_file_get_header (message_file, "date"); - _notmuch_message_set_date (message, date); + _notmuch_message_set_header_values (message, date, from, subject); _notmuch_message_index_file (message, filename); } else { -- cgit v1.2.3