mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user