Aaron Stone wrote: > On Tue, 2005-12-13 at 13:09 -0800, Kevin Brown wrote: > >>I wrote: >> >>>In experimenting with DBMail 2.0.7 (even with the changes I submitted >>>regarding the headername query, I can't get 2.1-trunk to run well >>>enough to work properly with both Mutt and Thunderbird), I discovered >>>(as perhaps some of you have) that storing changes to the attributes >>>is very slow when the folder has lots of messages (tens of thousands). >>> >>>2.1.x may have fixed this, though the query in question is the same. >>>But in 2.0.7, the following query is responsible for the bulk of the >>>time spent in the update: >>> >>> SELECT 'a',COUNT(*) FROM dbmail_messages WHERE mailbox_idnr='14' >>> AND (status='0' OR status='1') UNION SELECT 'b',COUNT(*) FROM >>> dbmail_messages WHERE mailbox_idnr='14' AND (status='0' OR >>> status='1') AND seen_flag=1 UNION SELECT 'c',COUNT(*) FROM >>> dbmail_messages WHERE mailbox_idnr='14' AND (status='0' OR >>> status='1') AND recent_flag=1 >> >>Umm...should I just submit a patch against 2.0.7 for this? What, if >>anything, do you guys want me to do about this? > > > Sure, I'm all for a patch against 2.0.7. Do we have any other 2.0.x > cleanups in SVN right now? > > Paul seems to be more familiar with this area of code, so I'd prefer to > leave it to him to integrate your work on this.
I my view the problem is not that the current query is slow. The core problem is that it's called too often. Kevin, I'd like a imap command sequence that triggers this problem so I can setup a testcase for 2.1. and start fixing this properly; move all mailbox code to dbmail-mailbox and do proper internal caching. I hate complex adhoc solutions, and the current query is just too beautiful to discard. What kind of gain do you think you can achieve here? 200%? That wont make this problem go away. Just to be clear; If you do have an elegant, readable and maintainable solution I'm all for it. Also, I'd like to hear more about your problems with mutt and tb. They work for me. -- ________________________________________________________________ Paul Stevens mailto:[EMAIL PROTECTED] NET FACILITIES GROUP PGP: finger [EMAIL PROTECTED] The Netherlands________________________________http://www.nfg.nl
