Re:Database development mistakes made by application developers
by Estragon on Monday December 13, 2010 @07:04AM
(#2000174)
Are there wrappers for database APIs which log the time spent on each query?
[ Parent
| on HN ]
Re:Database development mistakes made by application developers
by ZoFreX on Monday December 13, 2010 @08:08AM
(#2000325)
I know MySQL has an option to log slow queries for you: http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html
Re:Database development mistakes made by application developers
by IgorPartola on Monday December 13, 2010 @08:06AM
(#2000314)
The MySQL slow query log could be of use. Of course you don't get a stack trace this way but it's essentially free (as in built already and not a huge performance hit).
Re:Database development mistakes made by application developers
by robryan on Monday December 13, 2010 @09:44AM
(#2000575)
Problem I have with this log is that legitimately slow queries, in my case usually those where I have concatenated 100's or 1000's or inserts into one query, make it hard to use in a meaningful way.
It's possible I'm using it wrong, did get much past trying it out. Fairly easy to roll my own rough timer in a DB wrapper, haven't got around to finishing this yet though.
Re:Database development mistakes made by application developers
by morgo on Monday December 13, 2010 @09:21AM
(#2000505)
You can get a profile (strace like) in the Percona-enhanced releases:
http://www.percona.com/docs/wiki/percona-server:features:pro...
There is likely some overhead for this feature, as it needs to make more system calls (getrusage).