diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index bcd54383..ef3993dc 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -6560,7 +6560,8 @@ sub _find_best_index { } } - if (!$best_index && !$want_index) { + + if (!$best_index) { PTDEBUG && _d('Auto-selecting best index'); foreach my $index ( $tp->sort_indexes($tbl_struct) ) { if ( $index eq 'PRIMARY' || $indexes->{$index}->{is_unique} ) { diff --git a/lib/NibbleIterator.pm b/lib/NibbleIterator.pm index 3491d600..51c6720f 100644 --- a/lib/NibbleIterator.pm +++ b/lib/NibbleIterator.pm @@ -541,6 +541,7 @@ sub _find_best_index { } # still no best index? select amongst all candidates. + if (!$best_index) { PTDEBUG && _d('Auto-selecting best index'); foreach my $index ( $tp->sort_indexes($tbl_struct) ) {