-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, March 23, 2006 13:21, [EMAIL PROTECTED] wrote:
> So I think, I have an idea.


> What if we open a mailbox, get the message count from imap server,
> if it is above a user defined value (e.g. 20.000), then say sort only a
> few of them, (a user defined value?) eg 5000, and query only 5000 headers.

> If the user wants to view older messages, then we are querying another
> 5000 part of the mailbox.

Not entirely possible.  At least not with accurate results.  Plus I think
the hold up is in the processing of the THREAD results, and not the
fetching of the message headers.  The problem you're going to have is
you're going to have to fetch the whole thread response to find out which
block of 5000 you want to fetch.  The second problem is, 5000 messages
aren't necessarily going to be sequential numbers, so you cannot even
guess a range.

It might be wise to do one of the following:

  - Automagically turn off threading option on folders above X messages
  - Fetch only X days/weeks/months worth of threading information.

> I'm not an imap expert, but this method saves us to sort all messages in
> a folder, and we don't waste time, memory, pcu for this.

> So if there is 4Million messages in the folder, th user gets only the
> last 5000 headers, not the whole 4M, and the imap server have to sort only
> a 5000 peace of them, not all.

The only time we'd ever fetch the full 4M message headers was if you were
using client side sorting.  And if you are, then you'd stop using
SquirrelMail in an instant.  We never fetch the full headers of the emails
if server side sorting is enabled as we fetch the unique message ids from
the IMAP server pre-sorted (by the imap server) in the order we want them.
 We then find out what page the user is actively on, and how many messages
they wish to display, and fetch just those message headers.

We use the same code for fetching the message headers for both sort and
threading, so that points the finger back to the THREAD command,
suggesting that the processing time, and data fetching is all based around
the results from that call.  Just to give you a hint of processing time. 
Just for my IMAP server to do threading by references, without any PHP
code, or sorting, or header fetching, it took 3 seconds to process 526
messages.  I'll take a look at the processing times via SM tomorrow.


- -- 
Jonathan Angliss
<[EMAIL PROTECTED]>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iEYEARECAAYFAkQjlwgACgkQK4PoFPj9H3NFvgCgsdaAvtl/roXg0v1zYbsNn/Dy
Y7MAoO3qHLIHUZGVmyoNX4o7XT3jDcUN
=jWwm
-----END PGP SIGNATURE-----



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
--
squirrelmail-users mailing list
Posting Guidelines: 
http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
List Address: squirrelmail-users@lists.sourceforge.net
List Archives: 
http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id)95
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to