summaryrefslogtreecommitdiff
path: root/mysql-test/main/statistics_json.test
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2021-11-26 20:03:08 +0300
committerSergei Petrunia <psergey@askmonty.org>2022-01-19 18:10:11 +0300
commiteb6a9ad705009fc0e4b0654c862c23a28872dad2 (patch)
tree94e82af5d02321544a968dc14d2d501285624a54 /mysql-test/main/statistics_json.test
parent106c785e2d3357a6f6711907f9e20b04c6ec7f96 (diff)
downloadmariadb-git-eb6a9ad705009fc0e4b0654c862c23a28872dad2.tar.gz
MDEV-26886: Estimation for filtered rows less precise with JSON histogram
- Make Histogram_json_hb::range_selectivity handle singleton buckets specially when computing selectivity of the max. endpoint bound. (for min. endpoint, we already do that). - Also, fixed comments for Histogram_json_hb::find_bucket
Diffstat (limited to 'mysql-test/main/statistics_json.test')
-rw-r--r--mysql-test/main/statistics_json.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/main/statistics_json.test b/mysql-test/main/statistics_json.test
index c0c88895f05..23e5e7395a7 100644
--- a/mysql-test/main/statistics_json.test
+++ b/mysql-test/main/statistics_json.test
@@ -340,3 +340,17 @@ ANALYZE TABLE t1 PERSISTENT FOR ALL;
ALTER TABLE t1 MODIFY f TEXT, ORDER BY pk;
INSERT INTO t1 (f) VALUES ('bar');
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-26886: Estimation for filtered rows less precise with JSON histogram
+--echo #
+create table t1 (a tinyint) as select if(seq%3,seq,0) as a from seq_1_to_100;
+select count(*) from t1 where a <= 0;
+
+set histogram_type = JSON_HB, histogram_size=default;
+analyze table t1 persistent for all;
+analyze select * from t1 where a <= 0;
+analyze select * from t1 where a < 0;
+analyze select * from t1 where a > 0;
+analyze select * from t1 where a >= 0;
+drop table t1;