Peter Zaitsev posted Percona's answer to the question, "why use the slow query log instead of the PERFORMANCE_SCHEMA tables to gather information about query execution and timing?" At VividCortex, we don't currently use the PERFORMANCE_SCHEMA for this either. Instead, we capture and time queries by sniffing the TCP traffic to the server, and decoding the MySQL protocol. We extract rich information from the protocol, including the query text, timings, errors, warnings, query flags, and more.
In this post I'll explain why we do this and how it works relative to other options.
Query Capture Methods
What options exist for measuring queries the server executes? Here's a short list.
- query logs
- PERFORMANCE_SCHEMA
- packet inspection
- proxies
- tools that …