Thomas Mueller wrote:
Hi,

I get more and more user complaints that my IMAP server is terrible
slow, opening a mailbox takes very long.

I've analyzed that using PQA (http://pgfoundry.org/projects/pqa/, great
tool!), the output is attached if anyone is interested (includes all
databases, not only dbmail).

The main problem is in db.c, db_getmailbox():
SELECT COUNT(message_idnr), COUNT(message_idnr) - SUM(seen_flag),
SUM(recent_flag) FROM dbmail_messages WHERE mailbox_idnr = '5' AND
status < '2'
That query takes up to 15 seconds (!!).

That query is entirely my 'fault' and introduced in the same patch that used the botched the MAX().

Dbmail-1 solved this by splitting the query and doing clientside counting. That was too slow all over.

I guess your suggestion to undo the database abstraction has some merit, but we need to think about this some more before we go that way:

Most code *is* shared between drivers.
Drivers should be able to use backend optimized queries.

--
  ________________________________________________________________
  Paul Stevens                                         [EMAIL PROTECTED]
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands_______________________________________www.nfg.nl

Reply via email to