Lars, this code has changed subtly, but significantly this month:
there are no more quotes around numbers. I tried your query on my
mailbox, and the time went from 40 seconds to 5 seconds. Then I tried it
again and got a result in 0 seconds. Which means you can't trust my
40->5 results because my queries are cached. 'flush query cache' did not
actually flush the query cache, so I have no clue what's up :-\

Anyways, try the query with the quotes removed from around the numbers
and see if you see anything different!

Aaron


On Tue, 2006-11-07 at 09:39 +0100, Lars Kneschke wrote:
> Hello!
> 
> I'm still searching for performance bottlenecks. And i discovered
> another one.
> 
>  
> 
> I'm using mysql 4.1 and not the latest SVN snapshot of dbmail.
> Hopefully this code did not change in the last 3-4 weeks. :-)
> 
> 
>  
> 
> When searching for the subject, we are creating following query:
> 
>  
> 
> SELECT message_idnr FROM dbmail_messages m JOIN dbmail_physmessage p
> ON m.physmessage_id=p.id JOIN dbmail_headervalue v ON
> v.physmessage_id=p.id JOIN dbmail_headername n ON v.headername_id=n.id
> WHERE mailbox_idnr = '100' AND status IN ('0','1') AND headername LIKE
> 'subject' AND headervalue LIKE '%gentoo-%' ORDER BY message_idnr
> 
>  
> 
> This query tooks 15 seconds to finnish. :-(
> 
>  
> 
> The machine executing this query is really, really fast and has much
> ram. 
> 
>  
> 
> I'm still trying to analyse this  problem. Just want to let you know.
> 
> 
> 
> ______________________________________________________________________
> Lars Kneschke
> Metaways Infosystems GmbH
> Pickhuben 4
> 20457 Hamburg
> Germany
> 
> eGroupWare Training & Support ==> http://www.egroupware-support.net
> 
> E-Mail: mailto:[EMAIL PROTECTED]
> Web: http://www.metaways.de
> Tel: +49 (0)40 317031-21
> Fax: +49 (0)40 317031-81
> Mobile: +49 (0)175 9304324 
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to