Riaan, > > It is correct as it stands. It is not a condition, it is an expresion. > > ORDER BY expression [ ASC | DESC | USING operator ] [, ...] > > The rid=? compares the rid from a field with a recipient id > > we have in the message under test, returning true or false. > > The ORDER BY rid=? DESC ensures we get an exactly matching > > record first (metching e-mail address as well as a message-id), > > and if there are none than a match by message id suffices.
> Ah, I must be used to a different dialect of SQL. Not a dialect. Even MySQL understands an expression in ORDER BY: http://dev.mysql.com/doc/refman/5.0/en/select.html SELECT ... [ORDER BY {col_name | expr | position} [ASC | DESC], ...] > It seems like the only advantage of that preferential ordering is for the > snmp counter, as the 'rid' return value from that query is not used > anywhere else, and the other 4 return values are all from the msgs table > (static for multiple recipients).. Unless I'm missing something, I'm happy > here. You are missing the point. There may be multiple msgs records matching a current mail message, some may match by mail address only, some may match by message-id only, and some by both. The relevant piece of information is msgs.time_num, which serves to compute age and subsequently score points. It is desirable to match the most relevant message from the history, even if it is older than some other more loose match. Mark ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ AMaViS-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/
