After fix for MDEV-5926 , we see a regression for the filtered% column for testcase from MDEV-4350 :
create table t1 (a int);
insert into t1 values (1), (1);
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 values (0);
set use_stat_tables='preferably';
set histogram_size=127;
set histogram_type='SINGLE_PREC_HB';
analyze table t1;
flush table t1;
set optimizer_use_condition_selectivity=4;
mysql> explain extended select * from t1 where a=0;
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 1025 | 99.22 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
filtered% used to be 50%, now it's 99.22%. Both estimates are very wrong:
mysql> select a,count(*) from t1 group by a;
+------+----------+
| a | count(*) |
+------+----------+
| 0 | 1 |
| 1 | 1024 |
+------+----------+
But the new one is even worse than before.
relates to
MDEV-5926
EITS: Histogram estimates for column=least_possible_value are wrong
Closed
Sergei Petrunia
made changes -
2014-03-25 19:36
Field
Original Value
New Value
Labels
eits
Sergei Petrunia
made changes -
2014-03-25 19:38
Description
After fix for MDEV-5926 , we see a regression for the filtered% column for testcase from MDEV-4350 :
{noformat}
create table t1 (a int);
insert into t1 values (1), (1);
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 values (0);
set use_stat_tables='preferably';
set histogram_size=127;
set histogram_type='SINGLE_PREC_HB';
analyze table t1;
flush table t1;
set optimizer_use_condition_selectivity=4;
{noformat}
{noformat}
mysql> explain extended select * from t1 where a=0;
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 1025 | 99.22 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
{noformat}
After fix for MDEV-5926 , we see a regression for the filtered% column for testcase from MDEV-4350 :
{noformat}
create table t1 (a int);
insert into t1 values (1), (1);
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 values (0);
set use_stat_tables='preferably';
set histogram_size=127;
set histogram_type='SINGLE_PREC_HB';
analyze table t1;
flush table t1;
set optimizer_use_condition_selectivity=4;
{noformat}
{noformat}
mysql> explain extended select * from t1 where a=0;
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
| 1 | SIMPLE | t1 | ALL | NULL | NULL | NULL | NULL | 1025 | 99.22 | Using where |
+------+-------------+-------+------+---------------+------+---------+------+------+----------+-------------+
{noformat}
filtered% used to be 50%, now it's 99.22%. Both estimates are very wrong:
{noformat}
mysql> select a,count(*) from t1 group by a;
+------+----------+
| a | count(*) |
+------+----------+
| 0 | 1 |
| 1 | 1024 |
+------+----------+
{noformat}
But the new one is even worse than before.
Sergei Petrunia
made changes -
2014-03-25 19:42
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
made changes -
2014-03-25 19:42
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
[ psergey
]
Sergei Petrunia
made changes -
2014-03-25 19:42
Status
Open
[ 1
]
In Progress
[ 3
]
Sergei Petrunia
made changes -
2014-03-26 11:57
Fix Version/s
10.0.10
[ 14500
]
Sergei Petrunia
made changes -
2014-03-26 16:03
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2014-06-13 15:06
Workflow
defaullt
[ 37401
]
MariaDB v2
[ 42805
]
Sergei Golubchik
made changes -
2021-12-06 21:39
Workflow
MariaDB v3
[ 62515
]
MariaDB v4
[ 147696
]
{"report":{"fcp":1492.8000001907349,"ttfb":596.1000003814697,"pageVisibility":"visible","entityId":33601,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"a27555a2-3edf-468c-a78d-d4b245dd12bc","navigationType":0,"readyForUser":1571.7000002861023,"redirectCount":0,"resourceLoadedEnd":2037.9000000953674,"resourceLoadedStart":602.1000003814697,"resourceTiming":[{"duration":370.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":602.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":602.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":972.6000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":370.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":602.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":602.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":972.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":379.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":602.6000003814697,"connectEnd":602.6000003814697,"connectStart":602.6000003814697,"domainLookupEnd":602.6000003814697,"domainLookupStart":602.6000003814697,"fetchStart":602.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":602.6000003814697,"responseEnd":982,"responseStart":982,"secureConnectionStart":602.6000003814697},{"duration":481.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":602.8000001907349,"connectEnd":602.8000001907349,"connectStart":602.8000001907349,"domainLookupEnd":602.8000001907349,"domainLookupStart":602.8000001907349,"fetchStart":602.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":602.8000001907349,"responseEnd":1084.2000002861023,"responseStart":1084.2000002861023,"secureConnectionStart":602.8000001907349},{"duration":485.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":603,"connectEnd":603,"connectStart":603,"domainLookupEnd":603,"domainLookupStart":603,"fetchStart":603,"redirectEnd":0,"redirectStart":0,"requestStart":603,"responseEnd":1088.1000003814697,"responseStart":1088.1000003814697,"secureConnectionStart":603},{"duration":485.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":603.2000002861023,"connectEnd":603.2000002861023,"connectStart":603.2000002861023,"domainLookupEnd":603.2000002861023,"domainLookupStart":603.2000002861023,"fetchStart":603.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":603.2000002861023,"responseEnd":1088.6000003814697,"responseStart":1088.6000003814697,"secureConnectionStart":603.2000002861023},{"duration":485.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":603.4000000953674,"connectEnd":603.4000000953674,"connectStart":603.4000000953674,"domainLookupEnd":603.4000000953674,"domainLookupStart":603.4000000953674,"fetchStart":603.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":603.4000000953674,"responseEnd":1089,"responseStart":1089,"secureConnectionStart":603.4000000953674},{"duration":528.6000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":603.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":603.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1132.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":485.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":603.7000002861023,"connectEnd":603.7000002861023,"connectStart":603.7000002861023,"domainLookupEnd":603.7000002861023,"domainLookupStart":603.7000002861023,"fetchStart":603.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":603.7000002861023,"responseEnd":1089.6000003814697,"responseStart":1089.6000003814697,"secureConnectionStart":603.7000002861023},{"duration":528.4000000953674,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":603.8000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":603.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1132.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":486.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":604,"connectEnd":604,"connectStart":604,"domainLookupEnd":604,"domainLookupStart":604,"fetchStart":604,"redirectEnd":0,"redirectStart":0,"requestStart":604,"responseEnd":1090.4000000953674,"responseStart":1090.4000000953674,"secureConnectionStart":604},{"duration":724.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":604.8000001907349,"connectEnd":604.8000001907349,"connectStart":604.8000001907349,"domainLookupEnd":604.8000001907349,"domainLookupStart":604.8000001907349,"fetchStart":604.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":604.8000001907349,"responseEnd":1329.3000001907349,"responseStart":1329.3000001907349,"secureConnectionStart":604.8000001907349},{"duration":1421.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":605,"connectEnd":605,"connectStart":605,"domainLookupEnd":605,"domainLookupStart":605,"fetchStart":605,"redirectEnd":0,"redirectStart":0,"requestStart":605,"responseEnd":2026.7000002861023,"responseStart":2026.7000002861023,"secureConnectionStart":605},{"duration":253.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1174.4000000953674,"connectEnd":1174.4000000953674,"connectStart":1174.4000000953674,"domainLookupEnd":1174.4000000953674,"domainLookupStart":1174.4000000953674,"fetchStart":1174.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1174.4000000953674,"responseEnd":1428.3000001907349,"responseStart":1428.3000001907349,"secureConnectionStart":1174.4000000953674},{"duration":589.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1437.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1437.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2027.5,"responseStart":0,"secureConnectionStart":0},{"duration":591.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1438.7000002861023,"connectEnd":1438.7000002861023,"connectStart":1438.7000002861023,"domainLookupEnd":1438.7000002861023,"domainLookupStart":1438.7000002861023,"fetchStart":1438.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":1438.7000002861023,"responseEnd":2030.6000003814697,"responseStart":2030.6000003814697,"secureConnectionStart":1438.7000002861023},{"duration":598.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1439.1000003814697,"connectEnd":1439.1000003814697,"connectStart":1439.1000003814697,"domainLookupEnd":1439.1000003814697,"domainLookupStart":1439.1000003814697,"fetchStart":1439.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":1439.1000003814697,"responseEnd":2037.9000000953674,"responseStart":2037.9000000953674,"secureConnectionStart":1439.1000003814697},{"duration":577,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1482.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1482.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2059.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":398,"responseStart":596,"responseEnd":598,"domLoading":599,"domInteractive":2060,"domContentLoadedEventStart":2060,"domContentLoadedEventEnd":2107,"domComplete":2518,"loadEventStart":2518,"loadEventEnd":2518,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2031.5},{"name":"bigPipe.sidebar-id.end","time":2032.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":2032.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":2036.2000002861023},{"name":"activityTabFullyLoaded","time":2123.800000190735}],"measures":[],"correlationId":"85c1b116a53421","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":131,"dbReadsTimeInMs":23,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}