MySQL & InnoDB (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
Slow Query Log Analysis and `pt-query-digest`.
senior LevelmysqlAdvanced Internals
In Simple Words:
- Enable
slow_query_log = 1and setlong_query_time = 0.5(500ms). - Use Percona Toolkit's
pt-query-digest /var/log/mysql/slow.logto aggregate queries into fingerprint classes and identify queries consuming the highest cumulative CPU execution time.