Devel module includes a suite of query analysis tools. It can print a summary of all database queries for each page request at the bottom of each page, send the summary to firebug (via FirePHP from http://www.firephp.org/), or store executed queries for future analysis. The summary includes how many times each query was executed on a page , how long each query took, and what user and function ran the query.
These patches add a few lines to DataObject.php that adds executed query strings to the global $queries array.
I suspect that this could be a big help in discovering how to improve CiviCRM's database performance.