Hey, So I was reading through the sorting code, and realized that the copy of each message from the temporary delivery user to the destination user was much more expensive than I thought. I have rewritten db_copymsg() to use just 3 queries, where it used to be something like 10 queries!
The catch is that MySQL 4.0.14 or higher is required because prior to 4.0.14, an INSERT INTO table1 ... SELECT FROM table2, where table1 == table2, was not allowed. All versions of PostgreSQL support this SQL92 compliant query, though. IMHO, this is a really important feature and it is well worth excluding those earlier MySQL versions to get support for it; Ilja, is that OK with you? Aaron