分析仅包含select语句的慢查询日志pt-query-digestt--filtert'$event->{fingerprint}t=~tm/^select/i'tslow.log>tslow_report4.log 针对慢查询日志中用户为root的情况pt-query-digestt--filtert'($event->{user}t||t"")t=~tm/^root/i'tslow.log>tslow_report5.log 查询所有全表扫描或full join的慢查询日志pt-query-digestt--filtert'(($event->{Full_scan}t||t"")teqt"yes")t||(($event->{Full_join}t||t"")teqt"yes ")'tslow.log>tslow_report6.log 把查询保存到名为test的数据库中的query_review表,如果表不存在则自动创建pt-query-digesttt--user=roott–password=abc123t--reviewtth=localhost,D=test,t=query_reviewt--create-revi ew-tablettslow.log 把查询保存到query_history表pt-query-digesttt--user=roott–password=abc123t--reviewtth=localhost,D=test,t=query_thistoryt--create-re view-tablettslow.log_20140401 通过tcpdump抓取mysql的tcp协议数据,然后进行分析pt-query-digestt--typettcpdumptmysql.tcp.txt>tslow_report9.log 分析binlog日志mysqlbinlogtmysql-bin.000093t>tmys