Add a new buffer that will have the most n recent sql statements that have thrown an exception (has sql code), and the most recent n running max timed queries. Or possibly make this configurable based on other criteria.