[dev] [cvs] commit: imp/lib Mailbox.php imp/lib/IMAP Cache.php

Chuck Hagenbuch chuck at horde.org
Sun Apr 30 21:24:10 PDT 2006


Quoting Michael M Slusarz <slusarz at horde.org>:

> What about entirely caching search results - i.e. a search will result
> in a "snapshot" of message results.  Even if a user does something to
> the results (i.e. delete, change flags) that would normally cause the
> message to disappear from the search results, it will remain.  We
> could then provide a link in the header banner that would allow us to
> "Re-perform search".  Caching search results in this way would be
> *very* useful when doing large searches (i.e. a search on all
> mailboxes).  Personally, I wouldn't mind having this results be
> persistent in exchange for most improved performance - additionally,
> the idea that the search provides a "snapshot" of results is
> consistent with the way other search engines work (i.e. google doesn't
> update results after a page is loaded; windows search does not add
> newly created items to the results list after you have completed
> searching).

I'm fine with it not adding new items without explicitly re-searching,  
but if I delete something, I expect it to disappear. Same for flag  
changes - and that gets hairy if there are flag criteria on the  
search, but it's what I expect.

At the least I think we could cache the results _until_ a destructive  
action is taken.

> Virtual folders would be a separate story.  We would continue to
> re-run the search on every page access - since I expect virtual
> folders to show up-to-date results.  Unfortunately, I can't think of a
> way to reliably provide these results without having to do an IMAP
> search on every mailbox page load in a virtual folder, so we will not
> gain any benefits of caching in virtual folders.  This may just have
> to be the performance price we pay for this feature.  In any case,
> performance is equal to before so we aren't losing anything.

Agreed. Btw, something I noticed recently without having a chance to  
investigate:

http://us3.php.net/manual/en/function.imap-listscan.php

I wonder if there are times when doing a search, especially on body  
text, where it would be faster to do a listscan to narrow down the #  
of mailboxes, and then do the imap_search only on those mailboxes...

> Looking at this from a DIMP perspective, the current status of mailbox
> list caching won't get us much if we are using the trash folder.
> Since deleting a message when using trash will always alter the
> imap_status() signature, we are always going to be regenerating the
> mailbox list.  That being said, we do get performance gains if simply
> viewing messages, especially when switching between mailboxes, since
> these results are now cached and will remain valid until a new message
> appears.
>
> However, we do get massive performance gains if not using trash in
> DIMP since (even if we delete a message) we do not have to regenerate
> either the message list or (if using thread sort) the thread object.

What about with virtual trash?

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list