1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-17032: Estimates are higher for partitions of a table with @@use_stat_tables= PREFERABLY

The problem here is EITS statistics does not calculate statistics for the partitions of the table.
So a temporary solution would be to not read EITS statistics for partitioned tables.

Also disabling reading of EITS for columns that participate in the partition list of a table.
This commit is contained in:
Varun Gupta
2018-12-07 02:12:22 +05:30
parent 12b1ba195c
commit 4886d14827
7 changed files with 235 additions and 9 deletions

View File

@ -3322,14 +3322,17 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
{
Field **field_ptr;
TABLE *table= param->table;
partition_info *part_info= NULL;
#ifdef WITH_PARTITION_STORAGE_ENGINE
part_info= table->part_info;
#endif
uint parts= 0;
for (field_ptr= table->field; *field_ptr; field_ptr++)
{
Column_statistics* col_stats= (*field_ptr)->read_stats;
if (bitmap_is_set(used_fields, (*field_ptr)->field_index)
&& col_stats && !col_stats->no_stat_values_provided()
&& !((*field_ptr)->type() == MYSQL_TYPE_GEOMETRY))
Field *field= *field_ptr;
if (bitmap_is_set(used_fields, field->field_index) &&
is_eits_usable(field))
parts++;
}
@ -3347,12 +3350,10 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
uint max_key_len= 0;
for (field_ptr= table->field; *field_ptr; field_ptr++)
{
if (bitmap_is_set(used_fields, (*field_ptr)->field_index))
Field *field= *field_ptr;
if (bitmap_is_set(used_fields, field->field_index))
{
Field *field= *field_ptr;
Column_statistics* col_stats= field->read_stats;
if (field->type() == MYSQL_TYPE_GEOMETRY ||
!col_stats || col_stats->no_stat_values_provided())
if (!is_eits_usable(field))
continue;
uint16 store_length;