 <p>If you need information for more than the last 100 queries, you will simply need to collect existing data every 100 queries. I have implemented the latter feature in PHP PDO.</p> <p><a href="https://github.com/gajus/doll" rel="nofollow">https://github.com/gajus/doll</a></p> <p>This is an application layer solution.</p>