Zend Framework: Profiling Queries with Zend_Db
Using an abstraction layer (especially with caching) means that sometimes you don’t think much about exactly what you’re doing to the poor database. Here’s a good article on profiling your database queries and optimizing them. I’ve found that xdebug + webgrind is also a pretty good solution for when you just need to know how many times you’re nailing the “query” button in a script … sometimes I’ve been rather surprised.