Thanks for the feedback Joe.

Joe Cheng wrote:
It's more than that. When a client selects an IMAP mailbox, the server must tell it the number of messages flagged, existing, recent, unseen. These need to be *fast*. When an e-mail client starts up it might ask for these statistics over most or all of the folders that the user has.


Right.  Common flags, such has those declared manatory by
the IMAP RFC can be left as 'calculated properties' by the
backend.  In MAPI, The 'messages seen' property is calculated
by the container ( folder ) and is retrieve by a single
property request.  The folder object knows when a message is
added, and knows when a message is deleted, so it does not
ever have to traverse the messages to count them.

Also property searches are very close to the unlying 'data
store', ie. database, file system etc.  A data store that
has a very effecient search capability will return those
values near instantly.  For example if the 'backend' interface
is implemented on an embedded SQL database.  Eg. a 'Get all
unseen in the *entire* server for this user' is translated
to...

SELECT COUNT(*) FROM seen_flag_table
WHERE id IN
(
  SELECT message_id FROM Messages
  WHERE USER_ID = some_id
)

Or something like that.  Depends on how the backend setups
up the tables.

Regards,
Kervin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to