Merge branch 'pt-tcs-where-option-using-non-optimal-index-lp1576036' of github.com:percona/percona-toolkit into pt-tcs-where-option-using-non-optimal-index-lp1576036

This commit is contained in:
frank-cizmich
2016-05-11 18:10:05 -03:00
2 changed files with 3 additions and 1 deletions

View File

@@ -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} ) {

View File

@@ -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) ) {