From mboxrd@z Thu Jan 1 00:00:00 1970 From: rlane@club.cc.cmu.edu (Rich Lane) Date: Tue, 28 Jul 2009 11:57:56 -0400 Subject: [sup-talk] xapian question In-Reply-To: <1248716325-sup-7534@masanjin.net> References: <1248716325-sup-7534@masanjin.net> Message-ID: <1248795865-sup-6634@pion.club.cc.cmu.edu> Excerpts from William Morgan's message of Mon Jul 27 13:45:32 -0400 2009: > Hey, I finally get to ask a question! > > One of the mildly irritating things about Ferret was that it was > impossible to update the labels of a message without updating the entire > entry, i.e. including the body. So updating the labels of a message and > saving that to disk required either re-loading the body from the source, > or keeping the body explicitly in the index so that it could be loaded > without going back to the source. > > The latter approach is used by the current Ferret index implementation, > since it's significantly faster (especially for slow sources like IMAP > servers), but at the cost of a lot of disk space. > > My understanding of Xapian is that this is also the case, since fields > are essentially represented as prefixed terms, and so you're basically > updating a big blog, but I wanted to confirm this. I ask because the > entries.db file is very big. :) Xapian actually provides add_term and remove_term for documents. I'd definitely like to use these for label updates, but we need a way to tell if only the labels have changed in sync_message. Or, we update the index in Message#add_label/etc and get rid of the need to save buffers. That might not be an option for the Ferret index, though. We don't store the body in entries.db, just enough info for thread-index-mode. It's only about 800 bytes/message for me, but I don't have snippets enabled so yours would be larger.