Hello, The "hack" I planned actually turned out to be no hack. After over 2 hours of code study, I found that the required change was in just one line :) And moreover, that it's in another file and does not interfere with my first patch.
So, here goes a second patch. I've done a test on whether it works, but no massive performance testing yet. Whoever wants a max-speedy FETCH should allpy both of these patches to 2.0 and test. Yours, Mikhail Ramendik
--- dbmail-orig/db.c 2004-09-27 16:32:07.000000000 +0400 +++ dbmail-new/db.c 2004-10-26 19:07:47.000000000 +0400 @@ -2,6 +2,8 @@ /* Copyright (C) 1999-2004 IC & S [EMAIL PROTECTED] + Modified by Mikhail Ramendik [EMAIL PROTECTED] (MR) + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either @@ -3576,7 +3578,8 @@ "FROM dbmail_messageblks blk, dbmail_messages msg " "WHERE blk.physmessage_id = msg.physmessage_id " "AND msg.message_idnr = '%llu' " - "ORDER BY blk.messageblk_idnr ASC", msg_idnr); + "ORDER BY blk.messageblk_idnr ASC LIMIT 1", msg_idnr); +/*MR added LIMIT 1 - we are only getting the header, and therefore only use one row anyway */ if (db_query(query) == -1) { trace(TRACE_ERROR, "%s,%s: could not get message header",