log / capture all the queries executed in drupal
You want Devel. 

It has a lot of helpful tools for Drupal developers, including a helper function to print a summary of all database queries for each page request at the bottom of each page. The summary includes how many times each query was executed on a page (shouldn't run same query multiple times), and how long each query took.