-----BEGIN PGP SIGNED MESSAGE-----
On Thu, March 23, 2006 13:21, ecet@... 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 heade=
> 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 i=
> 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 o=
> 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 email=
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 message=
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 aroun=
the results from that call. Just to give you a hint of processing time.=20
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v188.8.131.52 (GNU/Linux)
-----END PGP SIGNATURE-----