On Freitag 29 Mai 2009 Jonathan Feally wrote: > The emailaddr column is used for sorting only. The headervalue column > is what is used for the where clauses. So the only column that needs > to be worried about for the index containing the data is the > headervalue.
Right, I meant the headervalue not emailaddr in my example. I just wrote the substring() stuff for the emailaddr field. > In most cases a 255 byte index on the emailaddr column > would be sufficient for sorting messages on the server side. Yes, in practice that's enough. > The > emailname is just there for future use. We cannot split the > recipients into multiple rows as that would break the imap sort back > to way it was where some messages could be sorted in a different > order than the rfc permits. > > Easier eplained as > Msg 1 to: c, a > Msg 2 to: b > Msg 3 to: c, b > > If we had 5 rows of the above recipients, then Msg 1 would be sorted > ahead of Msg 2, but the rfc says we can only look at the first > recipent, so really we should be sorting based on b, then c. Make a simple integer field "order" and have msg 1 order 1 to: c msg 1 order 2 to: a msg 2 order 1 to: b msg 3 order 1 to: c msg 3 order 2 to: b so you know the original order of the field, which you need anyway for headervalues with "unknown" content (that is, where you don't care about the content). I just remember: Searches are anyway always done as '%searchstring%', and therefore no index is used at all. So just drop any index over the headervalues field, there's just no sense for it (nobody needs to sort headervalues, right?). mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0660 / 415 65 31 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4 // Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev