There’s more sophisticated ways of logging and profiling SQL in Magento these days, but sometimes it’s still easier and quicker to drop down to the abstract Zend adapter and log your queries with a few discrete calls to Mage::Log
Almost every INSERT
, UPDATE
, SELECT
, and DELETE
goes through the methods in
lib/Zend/Db/Adapter/Abstract.php
Remember to clean up after yourself!