pan-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pan-devel] newsrc with DB


From: Jeffrey Stedfast
Subject: Re: [Pan-devel] newsrc with DB
Date: Wed, 09 Jun 2004 02:03:04 -0400

I'm not much of a database guy...but...

1. is a database really necessary?

"as far as I've seen, once those database worms eat into your brain,
every thumb looks like a nail" -- jwz

seriously tho. one should definitely read jwz's document on summary
files.

Evolution uses jwz's approach to summary files and it is EXTREMELY
scalable. I have multi-gigabyte mbox files in Evolution right now and
you wouldn't know it based on load time. Heck, based on load time you
might expect my folders are 5 or 6 messages tops :-)

2. if you use a database with a table that contains the message-id's of
the articles, PLEASE don't store the message-id as <address@hidden>, store it
as address@hidden - I say this for several reasons:

a. GMime decodes Message-Id's into the address@hidden format and so it will
keep consistancy with GMime's string representation of the message-id
b. GMime uses that format for message/partial's
c. GMime's References/In-Reply-To decoders decode into the same format
and are EXTREMELY valuable since you may note that Message-Id's may get
wrapped, include embedded comments, etc and so may be written in
multiple ways and still be equivalent (it's all in the rfcs). GMime
decodes them into the canonical form.
d. it saves 2 bytes per message-id? :-)

ok, exception to #2 is that using the first 8 bytes of the md5sum'd
(canonical) message-id might be just as good. plus it saves a ton more
memory :-)



On Sun, 2004-06-06 at 20:41, K. Haley wrote:
> I just realized what Charles ment about supporting newsrc files with the 
> DB back-end.  Since newsrc files track UIDs for physical servers, 
> loading new headers becomes a bit more complicated.  Things would have 
> to go something like this:
> 
> at startup:
> load list of servers from DB
> foreach server
>   foreach group in newsrc file
>     if group not in Group
>       add to Group
>     get Group:id
>     update subscibe status in main group list
>     get G_S:id
>     foreach UID
>       if G_S:id and UID in G_S_A
>         if Article:id !=NULL    update Article read status
>       else
>       add to G_S_A with Article:id = NULL
> 
> to load new headers:
> remove NEW status from exising articles in this group
> foreach new header on server
>   if msg-id not in Article
>     add to Article
>   get Article:id
>   if G_S:id and UID in G_S_A
>     if Article:id == NULL in G_S_A
>       update Article:id in G_S_A
>       mark Article read
>   else add to G_S_A
> 
> Hopefully that pseudo-code is not to difficult to understand.  I also 
> realize that there are ways to speed it up but that doesn't matter at 
> this point.
> 
> 
> ______________________________________________________________________
> _______________________________________________
> Pan-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/pan-devel
-- 
Jeffrey Stedfast <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]