Easy aggregation of your query statistics.
Tomas Doran < t0m@state51.co.uk >
Change your code to emit a comment for each query.
/* Filename@LINE_NO@subroutine */
SELECT *
FROM giant_table
JOIN other_giant_table
WHERE unindexed_field = 'hahaha';
You can see the comment when you SHOW PROCESSLIST
Really handy!
No use for lots of little queries in a loop though..
Example only - apply to your language of choice.
Example only (although our technique is similar in ruby)
Extension to MySQLProxy written in Lua.
Filters and aggregates your query comments.
Stores timing information, counts number of calls, row counts returned etc.
Adds extra commands to the MySQL vocabulary to get query stats back. CGI + JQuery to display in browser.
Solves the lots of queries in a loop problem.
NOT perl specific.
Code and presentation are on github:
http://andym.github.com/Quanto
Patches welcome, especially solutions for generating query comments in your language of choice, or a less crappy cgi.
Thanks!