
james at digisys
Apr 3, 2002, 10:58 AM
Post #1 of 1
(140 views)
Permalink
|
Hello Roel! I completely agree about the fetch/store/copy comands, and they seem pretty snappy in the CVS. Here is what I've been looking at. The one command that IMAP clients (like Mozilla) do often when opening a mailbox is "UID FETCH 1:* (FLAGS)". For what I see, this command goes into a loop where a SELECT is done for each IMAP flag of each message in the box. So my example mailbox (which is 4500 messages, a mailing list) would be doing over 25,000 queries to return the results. (which pounds the DB for like 11 seconds here) I was thinking that a much simpler method for responding to "UID FETCH 1:* (FLAGS)" would be to do a single query like: SELECT message_idnr, seen_flag, answered_flag, deleted_flag, flagged_flag, recent_flag, draft_flag FROM messages WHERE mailbox_idnr = 'X' Then just parse that single set of query results. Seems this would be increadibly fast in comparison. I realize that a UID FETCH command could come in with ranges like: "UID FETCH 418,499,512:550 (FLAGS)" But even this could be done with 3 selects. Two for selects for the individual messages and one for the message range. Basically 1 SELECT for each element in the comma separated list. I understand what you are saying about large mailboxes, many people do use IMAP folders for things like mailing lists. And the beauty of DBmail is that if the DB is properly indexed and queried it would have the ability to handle very large mailboxes. Something that *no* other imap server can claim. ;) Hoping some of this makes sense. I'm still trying to get familiar with the code, but this caught my eye to start. I'm still amazed at the amount of work you guys have done on this. I was very glad to find it... -James
|