When the debug options are enabled queries are logged to a table including various details. You can use the “DBAL debug” backend module to view the log:
Above the table you see a few items to click on:
FLUSH LOG clears the logging table.
JOINS shows you the logged table joins, if that feature has been enabled.
ERRORS shows just the entries that caused an error.
PARSING shows the results of the SQL parsing check, if that feature has been enabled.
LOG is what you see when you enter the module.
WHERE shows a log of all WHERE-clauses. This may be used to optimize the database structure or spot performance bottlenecks.
The main log table shows you when how many queries where executed from what script in how much time. If an error occurred, this is noted as well. If you click on the script name, you'll get a list of all queries to help you with debugging.
The DBAL extension makes heavy use of caching for field information. This includes primary keys, auto_increment fields and native/meta types of fields.
To see the cached data select View cached data in the DBAL Debug backend module. From there you can clear the cache file, if that seems necessary (it is automatically cleaned whenever the database structure is changed from within TYPO3).