diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-07 02:12:22 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-07 19:59:45 +0530 |
commit | 4886d14827c69877e8d089ae7c7f178a9a54ad7a (patch) | |
tree | 3e059163c76f6b52fae3b09d8e6cfee87da33814 /sql/partition_info.cc | |
parent | 12b1ba195cb0802053bc2fae3b507ec9721685f8 (diff) | |
download | mariadb-git-4886d14827c69877e8d089ae7c7f178a9a54ad7a.tar.gz |
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.
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 52bda560c1c..9d7d0d92686 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -3164,6 +3164,23 @@ void partition_info::print_debug(const char *str, uint *value) DBUG_PRINT("info", ("parser: %s", str)); DBUG_VOID_RETURN; } + +bool partition_info::field_in_partition_expr(Field *field) const +{ + uint i; + for (i= 0; i < num_part_fields; i++) + { + if (field->eq(part_field_array[i])) + return TRUE; + } + for (i= 0; i < num_subpart_fields; i++) + { + if (field->eq(subpart_field_array[i])) + return TRUE; + } + return FALSE; +} + #else /* WITH_PARTITION_STORAGE_ENGINE */ /* For builds without partitioning we need to define these functions |