[Commits] 2b38ffdeb2f: Code cleanup
revision-id: 2b38ffdeb2fb276ad9ec9d0968eedcfabd74fa2c (mariadb-10.6.1-349-g2b38ffdeb2f) parent(s): 840afb3b376b853041ea04768846c5f62564bd6c author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2022-01-19 18:02:40 +0300 message: Code cleanup --- mysql-test/include/json_hb_histogram.inc | 2 +- sql/opt_histogram_json.cc | 2 +- sql/opt_histogram_json.h | 7 +++---- sql/sql_statistics.cc | 6 ++---- sql/sql_statistics.h | 6 ++---- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mysql-test/include/json_hb_histogram.inc b/mysql-test/include/json_hb_histogram.inc index 0805a7f0e53..0820fb5fccb 100644 --- a/mysql-test/include/json_hb_histogram.inc +++ b/mysql-test/include/json_hb_histogram.inc @@ -1,3 +1,3 @@ -# The time on ANALYSE FORMAT=JSON is rather variable +# Remove non-deterministic parts of JSON_HB histogram --replace_regex /("(collected_at|collected_by)": )"[^"]*"/\1"REPLACED"/ diff --git a/sql/opt_histogram_json.cc b/sql/opt_histogram_json.cc index 55848c58e2d..f2be4e5c0fb 100644 --- a/sql/opt_histogram_json.cc +++ b/sql/opt_histogram_json.cc @@ -914,7 +914,7 @@ double position_in_interval(Field *field, const uchar *key, uint key_len, double Histogram_json_hb::point_selectivity(Field *field, key_range *endpoint, - double avg_sel, double total_rows) + double avg_sel) { const uchar *key = endpoint->key; if (field->real_maybe_null()) diff --git a/sql/opt_histogram_json.h b/sql/opt_histogram_json.h index 48e9a29c8a5..e9b69869f4b 100644 --- a/sql/opt_histogram_json.h +++ b/sql/opt_histogram_json.h @@ -41,8 +41,8 @@ ] } - The histogram is an object with single member named Histogram_json_hb:: - JSON_NAME. The value of that member is an array of buckets. + Histogram is a JSON object. It has some global properties and "histogram_hb" + member whose value is a JSON array of histogram buckets. Each bucket is an object with these members: "start" - the first value in the bucket. @@ -126,8 +126,7 @@ class Histogram_json_hb : public Histogram_base ulonglong size) override; double point_selectivity(Field *field, key_range *endpoint, - double avg_selection, - double total_rows) override; + double avg_sel) override; double range_selectivity(Field *field, key_range *min_endp, key_range *max_endp, double avg_sel) override; diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index fc8e38173c7..84d0902193b 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3894,8 +3894,7 @@ double get_column_range_cardinality(Field *field, { res= col_non_nulls * hist->point_selectivity(field, min_endp, - avg_frequency / col_non_nulls, - tab_records); + avg_frequency / col_non_nulls); } } else if (avg_frequency == 0.0) @@ -3989,8 +3988,7 @@ double get_column_range_cardinality(Field *field, */ double Histogram_binary::point_selectivity(Field *field, key_range *endpoint, - double avg_sel, - double total_records) + double avg_sel) { double sel; Column_statistics *col_stats= field->read_stats; diff --git a/sql/sql_statistics.h b/sql/sql_statistics.h index 1950f3268a7..c0df15ea4ad 100644 --- a/sql/sql_statistics.h +++ b/sql/sql_statistics.h @@ -188,8 +188,7 @@ class Histogram_base virtual double point_selectivity(Field *field, key_range *endpoint, - double avg_selectivity, - double total_rows)=0; + double avg_sel)=0; virtual double range_selectivity(Field *field, key_range *min_endp, key_range *max_endp, double avg_sel)=0; @@ -359,8 +358,7 @@ class Histogram_binary : public Histogram_base Estimate selectivity of "col=const" using a histogram */ double point_selectivity(Field *field, key_range *endpoint, - double avg_sel, - double total_rows) override; + double avg_sel) override; };
participants (1)
-
psergey