Merge pull request #734 from jmrenouard/master

Bug: Database with views only gets index recommendation #721
This commit is contained in:
Jean-Marie Renouard 2023-09-26 22:45:09 +02:00 committed by GitHub
commit 8de551ced9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7076,9 +7076,12 @@ ENDSQL
infoprint " +-- COMMENT : " . $info[5] if defined $info[5]; infoprint " +-- COMMENT : " . $info[5] if defined $info[5];
$found++; $found++;
} }
badprint "No index found for $dbname database" if $found == 0; my $nbTables=select_one(
"SELECT count(*) from information_schema.TABLES WHERE TABLE_TYPE ='BASE TABLE' AND TABLE_SCHEMA='$dbname'"
);
badprint "No index found for $dbname database" if $found == 0 and $nbTables>1;
push @generalrec, "Add indexes on tables from $dbname database" push @generalrec, "Add indexes on tables from $dbname database"
if $found == 0; if $found == 0 and $nbTables>1;
} }
return return
unless ( defined( $myvar{'performance_schema'} ) unless ( defined( $myvar{'performance_schema'} )