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/notmuch-private.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/notmuch-private.h') diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 0d3cc27e..60a932fc 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -93,7 +93,9 @@ NOTMUCH_BEGIN_DECLS typedef enum { NOTMUCH_VALUE_TIMESTAMP = 0, - NOTMUCH_VALUE_MESSAGE_ID + NOTMUCH_VALUE_MESSAGE_ID, + NOTMUCH_VALUE_FROM, + NOTMUCH_VALUE_SUBJECT } notmuch_value_t; /* Xapian (with flint backend) complains if we provide a term longer @@ -269,9 +271,10 @@ void _notmuch_message_ensure_thread_id (notmuch_message_t *message); void -_notmuch_message_set_date (notmuch_message_t *message, - const char *date); - +_notmuch_message_set_header_values (notmuch_message_t *message, + const char *date, + const char *from, + const char *subject); void _notmuch_message_sync (notmuch_message_t *message); -- cgit v1.2.3