PT-DUPLICATE-KEY-CHECKEUser)Contributed Perl DocumentPT-DUPLICATE-KEY-CHECKER(1p)
indexes and foreign keys. Connection options are read from MySQL option
all database tools can pose a risk to the system and the database server.
Before using this tool, please:
if it finds indexes that cover the same columns as another index in the
same order, or cover an exact leftmost prefix of another index, it prints
out the suspicious indexes. By default, indexes must be of the same type,
so a BTREE index is not a duplicate of a FULLTEXT index, even if they have
the same columns. You can override this.
the same columns as another in the same table, and references the same
total size, in bytes, that the duplicate indexes are using. This is
calculated by multiplying the index length by the number of rows in their
“SYNOPSIS” and usage information for details.
same columns as a FULLTEXT index is not really a duplicate, for
STDOUT to utf8, passes the mysql_enable_utf8 option to DBD::mysql, and
runs SET NAMES UTF8 after connecting to MySQL. Any other value sets
binmode on STDOUT without the utf8 layer, and runs SET NAMES after
connecting to MySQL.
primary key, and treats it as a duplicate key. Only detects this
condition on storage engines whose primary keys are clustered
(currently InnoDB and solidDB).
nodes of all secondary keys anyway, so you might consider it redundant
to have them appear in the internal nodes as well. Of course, you may
also want them in the internal nodes, because just having them at the
leaf nodes won’t help for some queries. It does help for covering
index queries, however.
KEY `b` (`b`,`a`)
have the following query:
we shorten the index on “b,a” to just “b” and also remove the ORDER
BY, the query should return the same results.
key and re-adding it without the primary key prefix. The shortened
clustered key may still duplicate another key, but the tool cannot
currently detect when this happens without being ran a second time to
re-check the newly shortened clustered keys. Therefore, if you
shorten any duplicate clustered keys, you should run the tool again.
must be the first option on the command line.
qualified with the database name.
must be escaped with a backslash: “exam\,ple”
already exists and the PID it contains is different than the current
PID. However, if the PID file exists and the PID it contains is no
longer running, the tool will overwrite the PID file with the current
PID. The PID file is removed automatically when the tool exits.
example, specifying “–set-vars wait_timeout=500” overrides the
defaultvalue of 10000.
TABLE DROP KEY statement is printed below each duplicate key so that,
if you want to remove the duplicate key, you can copy-paste the
statement into MySQL.
additional features. First, the tool checks the version of other
programs on the local system in addition to its own version. For
example, it checks the version of every MySQL server it connects to,
Perl, and the Perl module DBD::mysql. Second, it checks for and warns
about versions with known problems. For example, MySQL 5.5.25 had a
critical bug and was re-released as 5.5.25a.
normal output. This feature should never interfere with the normal
operation of the tool.
“option=value”. The options are case-sensitive, so P and p are not the
same option. There cannot be whitespace before or after the “=” and if
the value contains whitespace it must be quoted. DSN options are comma-
separated. See the percona-toolkit manpage for full details.
must be escaped with a backslash: “exam\,ple”
STDERR. To enable debugging and capture all output to a file, run the
megabytes of output.
installed in any reasonably new version of Perl.
Include the following information in your bug report:
http://www.percona.com/software/percona-toolkit/> to download the
latest release of Percona Toolkit. Or, get the latest release from the
ABOUT PERCONA TOOLKIT
line tools for MySQL developed by Percona. Percona Toolkit was forked
from two projects in June, 2011: Maatkit and Aspersa. Those projects were
created by Baron Schwartz and primarily developed by him and Daniel
Nichter. Visit <
http://www.percona.com/software/> to learn about other
free, open-source software from Percona.
COPYRIGHT, LICENSE, AND WARRANTY
2007-2011 Baron Schwartz.
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
under the terms of the GNU General Public License as published by the Free
Software Foundation, version 2; OR the Perl Artistic License. On UNIX and
similar systems, you can issue `man perlgpl’ or `man perlartistic’ to read
with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA.
perl v5.20.2 2015-11-06 PT-DUPLICATE-KEY-CHECKER(1p)