Percona Toolkit usage tutorial-Performance Tools

Source: Internet
Author: User
Tags percona

Percona-toolkit usage tutorial-Performance Tools

1. pt-index-usage

Function introduction:

Read the plug-in statement from the log file and explain how they use the index. After the analysis is completed, a report about the index that has not been used for query is generated.

Usage:

Pt-index-usage [OPTION...] [FILE...]

You can obtain the SQL directly from the slow query. The SQL format in the FILE must be the same as that in the slow query. If it is not always necessary, Use pt-query-digest to convert it. You can also save the Report to the database without generating it. For details, see the following example.

Example:

An example of how to view index usage from an SQL statement in full query:

Pt-index-usage/data/dbdata/localhost-slow.log -- host = localhost -- user = root -- password = zhang @ 123

Save the analysis result to the database example:

Pt-index-usage/data/dbdata/localhost-slow.log -- host = localhost -- user = root -- password = zhang @ 123 -- no-report -- create-save-results-database

Use -- create-save-results-database to automatically generate a database and a table to save the results.

2. pt-pmp

Function introduction:

Execute the aggregated GDB stack trace for the query program. The advanced stack trace is used to summarize the tracing information.

Usage:

Pt-pmp [OPTIONS] [FILES]

Example:

Pt-pmp-p 21933

Pt-pmp-B/usr/local/mysql/bin/mysqld_safe

3. pt-visual-explain

Function introduction:

The explain execution plan is formatted and output in tree mode for easy reading.

Usage:

Pt-visual-explain [OPTION...] [FILE...]

For more information about option, see the official website!

Example:

Example of an aaa file containing the explain result:

Pt-visual-explain aaa

Example of viewing aaa files containing query statements:

Pt-visual-explain -- connect aaa -- user = root -- password = zhang @ 123

An example of the explain output result can be directly viewed in a pipeline:

Mysql-uroot-pzhang @ 123-e "explain select email from test. collect_data where id = 101992419" | pt-visual-explain

Percona Toolkit: click here
Percona Toolkit: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.