I found a useful little tool the other day.
Practical Query Analyzer
(written in ruby) will parse a postgresql or mysql log (though at last look mysql support was broken) and tell you what sort of queries are being run. This can help you work out where to concentrate on increasing speed or reducing the number of queries being run.
I use mysql a lot at work so I wrote a small perl script to give me the same output. My ruby skills are extremely basic so it seemed easier to do it in perl.