Fetch of FLAGS is redundant



19 years ago
7 years ago


(Reporter: bugzilla, Unassigned)



Firefox Tracking Flags

(Not tracked)




19 years ago
According to:

"After the SELECT, I see:
<0.016<9 UID fetch 1:* (FLAGS)

followed by a bunch of caption fetches, in chunks:

<0.109<10 UID fetch 22267,22269:22271,22273:22275,22277:22279 (UID RFC822.SIZE 
FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Priority X-Priority 
Message-ID References Newsgroups)])

In the second UID FETCH, the "FLAGS" fetch item is redundant--the client already 
knows all the flags from the first fetch.  It shouldn't ask for the flags twice.

I presume the reason the first UID FETCH is separate from the rest is to get the 
msgno-to-UID mappings.  One suggestion is to replace the first UID FETCH with a 
"UID SEARCH UID 1:*".  That is much more compact in protocol, and the omitted 
flags may be retrieved by the caption fetches.

The UID sets that it sends in the chunked header fetches are much longer than 
they need to be.  It could have used a UID set of "22267:222593" instead of the 
7-line monstrosity it currently sends.  The client knows that UIDs 22268,22272, 
etc. are not in the mailbox, it should not worry about including them in UID 

Even better, the second UID FETCH shouldn't been a UID FETCH at all.  It could 
have done a "FETCH 1:200", completely removing the need for the first UID 

Comment 1

19 years ago
Keywords: perf
Target Milestone: --- → Future


18 years ago
Keywords: mail1

Comment 2

17 years ago
taking. It's a little more complicated than this, but I've been re-working the
way we build up the folder list, when we fetch flags, etc, and this will be part
of that.
Assignee: mscott → bienvenu


16 years ago
QA Contact: lchiang → stephend
Product: MailNews → Core
David, obsolete?
QA Contact: stephend → networking.imap

Comment 4

11 years ago
No, not obsolete. Parts of comment 0 are obsolete (e.g., we do coalesce ranges now) or incorrect, but the fetching of the flags is essentially redundant. I'm not sure how hard or worthwhile it would be to fix it.

The reason we always fetch all the flags is in case the flags have changed on the server, e.g., by an other client or from a different machine. We only fetch the headers once per message, but we sync the flags every time.

Comment 5

11 years ago
After a connection drops and is re-established, one does need to re-fetch the flags.  If the connection is still up, it is not necessary to re-fetch flags, as the server will send you unsolicited notifications whenever any flags you previously fetched in that connection have changed.


10 years ago
Product: Core → MailNews Core


10 years ago
Severity: normal → minor
Priority: P3 → --
Target Milestone: Future → ---


7 years ago
Assignee: dbienvenu → nobody
You need to log in before you can comment on or make changes to this bug.