Persist messages locally: #3742

This completes the heavy lifting of persisting messages locally.  The strategy is that the local database may be sparsely populated, both in the availability of messages in a folder and the fields of a message that is partially stored.  As data is pulled from the remote server it's always stored in the database.  Future requests will always go to the database first, preventing unnecessary network traffic.

Also, this patch will detect when a message is stored in multiple folders on the server.  The database uses soft links from the folder to the message, so the message is stored only once in the database.  This technique relies heavily on the availability and validity of the Message-ID header, but we expect this to be reliable the vast majority of the time.
This commit is contained in:
Jim Nelson 2011-06-23 19:07:04 -07:00
parent 4ccabcbd3e
commit d179cb9bdd
26 changed files with 1143 additions and 273 deletions

View file

@ -18,6 +18,7 @@ CREATE INDEX FolderTableParentIndex ON FolderTable(parent_id);
CREATE TABLE MessageTable (
id INTEGER PRIMARY KEY,
fields INTEGER,
date_field TEXT,
date_time_t INTEGER,