Details
-
Bug
-
Status: On Hold
-
Low
-
Resolution: Unresolved
-
None
-
None
Description
**Reported in Launchpad by Bill Karwin last update 22-11-2017 18:56:50
One of the most common questions I see about pt-query-digest is "how do I filter the report for queries that use a specific table?"
The answer is something like:
pt-query-digest -filter '$qr>distill($event->
) =~ /\bMyTable\b/i' \
/var/log/mysql/mysql-slow.log
But use of $qr->distill() is not documented, except a brief mention in the group-by section.
But it is not mentioned that to use the distill result in a filter, we have to call the distill() function because the result of the distill is not a field in the $event object by default.
I suggest this example of filtering by a specific table be added to the pt-query-digest manual, because this use case is pretty popular.