Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Kevin Brown
Paul J Stevens wrote: > > 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. Yeah, that too. :-) I figured i

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Kevin Brown
I wrote: > The latest problem I've had with 2.1.x-trunk is related to > dbmail-smtp. I use the mailbox2dbmail contrib script to populate > dbmail from my primary mail store and in the 2.1.x series the mail > server returns nothing when you attempt to retrieve a message. The > headers come back fi

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Kevin Brown
Paul J Stevens wrote: > Just to be clear; If you do have an elegant, readable and > maintainable solution I'm all for it. Hmm...well, the following query might not qualify but it certainly does the trick and removes the need for an internal array. We still have to do a sum of all the results but

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Paul J Stevens
Kevin Brown wrote: > I'll create a patch against 2.0.7 for this if you guys are interested. Please do. It won't work for mysql-4.0 because of the sub-select. But I can include it in the debian packages as a separate patch, and integrate in into trunk. -- _

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Paul J Stevens
Kevin Brown wrote: >>From what I can tell, just doing a STORE of attributes is enough. I > can recreate the problem and email you the logs if you're interested. I was more like thinking about some sort of lazy caching where _ic_store does not call db_getmailbox if the previous imap command was

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Aaron Stone
On Tue, 2005-12-13 at 23:35 -0800, Kevin Brown wrote: > Paul J Stevens wrote: > > Just to be clear; If you do have an elegant, readable and > > maintainable solution I'm all for it. [snip] > The above works in MySQL versions 4.1 and greater (might work with > earlier versions, but I don't know and

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Kevin Brown
Aaron Stone wrote: > Something without a subquery is needed, as the 2.0 series must continue > to work with MySQL 4.0.x. We can't just force people to upgrade to 4.1.x? It'd be good for them. Forcing them to upgrade to PostgreSQL would be even better. Hey, I can dream, can't I? :-) Anyway, th

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Abdullah Ibn Hamad Al-Marri
Kevin Brown <[EMAIL PROTECTED]> wrote: Aaron Stone wrote: > Something without a subquery is needed, as the 2.0 series must continue > to work with MySQL 4.0.x. We can't just force people to upgrade to 4.1.x? It'd be good for them. Forcing them to upgrade to PostgreSQL would be even better. Hey, I

Re: [Dbmail-dev] STORE is SLOOOOOW on folder with many, many messages

2005-12-14 Thread Geo Carncross
I wrote this query back in <[EMAIL PROTECTED]> I also suggested the alternative: select count(*), count(case when seen_flag > 0 Then 1 else null end), count(case when recent_flag > 0 then 1 else null end) FROM dbmail_messages WHERE status < '2' and mailbox_idnr='1'; in <[EMAIL PROTECTED]> but I