On Thu, Jun 28, 2007 at 01:35:22AM -0700, Aaron Stone wrote:
> On Thu, 2007-06-28 at 10:02 +0200, Marc Dirix wrote:
> > >
> > > Right, and mysql can, too.  But looking at eg. the "slow squirrelmail"
> > > thread on the dbmail list right now, if dbmail itsself provided timing
> > > along with all the other level 5 info, there would be no need to be
> > > requesting that from the original poster.  That's a somewhat common  
> > > info
> > > request, so would save time debuggging things.  It wouldn't slow  
> > > things
> > > too much (primarily the extra log message) .. and as you mentioned,  
> > > level
> > > is slow, it's only for debugging problems, not real use.
> > >
> > 
> > As most do these sort of debugging on the production system, I would  
> > say every performance hit
> > has to be taken with care. I would not like to put anymore strain on  
> > the users then necessary when
> > already debugging a "slow" problem.
> 
> How expensive can doing this ourselves this be? Two calls to time(2),
> subtract, compare with some threshold value, log if it exceeds that.
> Seems like a great deal because we can log slow queries at a higher
> level, making it less expensive to debug problems like these.

PostgreSQL uses gettimeofday() to handle a bunch of stuff, and we've
found that in some environments it's got a pretty substantial overhead.
For example, EXPLAIN ANALYZE (which makes heavy use of gettimeofday())
can sometimes take 30% longer than running the query by itself. So I
wouldn't just hand-waive this away. OTOH, if each time you run it you're
sending a command across the wire to a database server...

BTW, for performance-conscious folks, converting raw query calls into
functions/procedures could produce a good gain, *especially* in cases
where you're sending multiple commands to do something.
-- 
Decibel!, aka Jim C. Nasby, Database Architect  [EMAIL PROTECTED] 
Give your computer some brain candy! www.distributed.net Team #1828

Attachment: pgp0PjXPzOt3W.pgp
Description: PGP signature

_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to