Pt-duplicate-key-checker

Suppose I have an index X on column A which is used as a constraint in a relation. And I have an index Y on columns A,B.

Then pt-duplicate-key-checker shows up index X as a redundant index. But I don’t think it is, is it? It’s required for the constraint.

I’m assuming your constraint is a foreign key? Foreign Keys can use a multi-column index for their constraint reference. Example:

INDEX (A, B);
FOREIGN KEY (A) REFERENCES tableFoo (id);

So yes, even with FKs, (A) by itself is still duplicate as (A, B) can be used by the FK.

This is known bug, reported at [PT-1414] - Percona JIRA