Updated number of expected rows from 2 to 100 for information_schema tables

The reason is that 2 is usually way to low and as information_schema
tables may have implicit locks when accessing rows, it is better that
the optimizer doesn't think that these tables are 'very small and fast'.

This change will affect a very small set of test cases.
This commit is contained in:
Monty 2022-10-28 18:17:53 +03:00 committed by Sergei Petrunia
parent 15cce52bc9
commit 4464aa4628

View file

@ -5377,7 +5377,14 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
s->dependent= tables->dep_tables;
if (tables->schema_table)
table->file->stats.records= table->used_stat_records= 2;
{
/*
Information schema is slow and we don't know how many rows we will
find. Be setting a moderate ammount of rows we are more likely
to have it materialized if needed.
*/
table->file->stats.records= table->used_stat_records= 100;
}
table->opt_range_condition_rows= table->stat_records();
s->on_expr_ref= &tables->on_expr;