On Tue, 10 Nov 2015 10:44:37 +0000
Alan Hicks <ahi...@p-o.co.uk> wrote:

> Hi,
> 
> This slowing down might be able to be refactored out as I'm unsure why, 
> on inserting a message, a tree of messages is needed.  I haven't looked 
> at the code recently but didn't think dbmail retrieved the messages 
> before or after an insert.
> 
> It's normal for databases to prefer a table scan rather than use an 
> index when it thinks the number of rows exceeds the benefit of using an 
> index.
> 
> Alan

I did some more "printf style" profiling on that while loop with some 
interesting results.

If I put calls to clock_gettime just outside of a loop and display difference 
at the end, I get say 14.something seconds. If I put these calls inside the 
loop and print out the duration of each pass thru the loop and then sum them 
up, I get about 0.04 second.

So I'm either doing something wrong or something interesting is going on inside 
libzdb, to which db_result_next(r) translates.

Digging further ...


-- 

Jure Pečar
https://jure.pecar.org
http://f5j.eu
_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to