Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
None
Component/s:
None
ANALYZE will show "Table is already up to date" while it re-calculates and updates table statistics.
I think, this is misleading. For me, "Table is already up to date" means that "statistics were not updated", while actually statistics was updated.
Below is an example where I generate a histogram with size=10, then run another ANALYZE to generate a histogram with size=20, and get "Table is already up to date" message.
MariaDB [test]> create table t1 (a int);
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> set @a:=-1;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> insert into t1 select @a:=@a+1 from information_schema.session_variables;
Query OK, 404 rows affected (0.03 sec)
Records: 404 Duplicates: 0 Warnings: 0
MariaDB [test]> set histogram_size=10;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> set histogram_type='single_prec_hb';
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> analyze table t1 persistent for all;
+---------+---------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------+---------+----------+----------+
| test.t1 | analyze | status | OK |
+---------+---------+----------+----------+
1 row in set (0.01 sec)
MariaDB [test]> select *, hex(histogram) from mysql.column_stats\G
*************************** 1. row ***************************
db_name: test
table_name: t1
column_name: a
min_value: 0
max_value: 403
nulls_ratio: 0.0000
avg_length: 4.0000
avg_frequency: 1.0000
hist_size: 10
hist_type:
histogram: �.E\s����
hex(histogram): 162E455C738BA2B9D0E8
1 row in set (0.00 sec)
MariaDB [test]> set histogram_size=20;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> analyze table t1 persistent for all;
+---------+---------+----------+-----------------------------+
| Table | Op | Msg_type | Msg_text |
+---------+---------+----------+-----------------------------+
| test.t1 | analyze | status | Table is already up to date |
+---------+---------+----------+-----------------------------+
1 row in set (0.01 sec)
MariaDB [test]> select *, hex(histogram) from mysql.column_stats\G
*************************** 1. row ***************************
db_name: test
table_name: t1
column_name: a
min_value: 0
max_value: 403
nulls_ratio: 0.0000
avg_length: 4.0000
avg_frequency: 1.0000
hist_size: 20
hist_type:
histogram:
�$0<HT`my���������
hex(histogram): 0C1824303C4854606D7985919EAAB6C2CEDAE6F2
1 row in set (0.00 sec)
relates to
MDEV-4145
Take into account the selectivity of single-table range predicates on non-indexed columns when searching for the best execution plan
Closed
Sergei Petrunia
made changes -
2013-04-03 13:28
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
made changes -
2014-03-26 16:04
Labels
mwl#253
eits mwl#253
Sergei Petrunia
made changes -
2014-03-27 22:29
Assignee
Igor Babaev
[ igor
]
Sergei Petrunia
[ psergey
]
Sergei Petrunia
made changes -
2014-03-27 22:34
Fix Version/s
10.0.10
[ 14500
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2014-06-13 15:06
Workflow
defaullt
[ 26848
]
MariaDB v2
[ 43135
]
Sergei Golubchik
made changes -
2021-12-06 21:38
Workflow
MariaDB v3
[ 62874
]
MariaDB v4
[ 146580
]
{"report":{"fcp":854,"ttfb":258.7999999523163,"pageVisibility":"visible","entityId":23546,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"bb696f40-b6d8-40c7-966e-a44ac9b07827","navigationType":0,"readyForUser":993.1999999880791,"redirectCount":0,"resourceLoadedEnd":592.1999999880791,"resourceLoadedStart":266.5999999642372,"resourceTiming":[{"duration":67.40000003576279,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":266.5999999642372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.5999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":334,"responseStart":0,"secureConnectionStart":0},{"duration":68.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":266.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":335.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":216.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":266.89999997615814,"connectEnd":266.89999997615814,"connectStart":266.89999997615814,"domainLookupEnd":266.89999997615814,"domainLookupStart":266.89999997615814,"fetchStart":266.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":336.89999997615814,"responseEnd":483.19999998807907,"responseStart":359.39999997615814,"secureConnectionStart":266.89999997615814},{"duration":324.9000000357628,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":267.2999999523163,"connectEnd":267.2999999523163,"connectStart":267.2999999523163,"domainLookupEnd":267.2999999523163,"domainLookupStart":267.2999999523163,"fetchStart":267.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":337.89999997615814,"responseEnd":592.1999999880791,"responseStart":362.0999999642372,"secureConnectionStart":267.2999999523163},{"duration":96.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":267.39999997615814,"connectEnd":267.39999997615814,"connectStart":267.39999997615814,"domainLookupEnd":267.39999997615814,"domainLookupStart":267.39999997615814,"fetchStart":267.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":338.5999999642372,"responseEnd":363.69999998807907,"responseStart":361.19999998807907,"secureConnectionStart":267.39999997615814},{"duration":100.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":267.69999998807907,"connectEnd":267.69999998807907,"connectStart":267.69999998807907,"domainLookupEnd":267.69999998807907,"domainLookupStart":267.69999998807907,"fetchStart":267.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":340,"responseEnd":368,"responseStart":364.2999999523163,"secureConnectionStart":267.69999998807907},{"duration":100.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":267.89999997615814,"connectEnd":267.89999997615814,"connectStart":267.89999997615814,"domainLookupEnd":267.89999997615814,"domainLookupStart":267.89999997615814,"fetchStart":267.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":342.0999999642372,"responseEnd":368.19999998807907,"responseStart":365,"secureConnectionStart":267.89999997615814},{"duration":72.19999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":268,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":340.19999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":101.59999996423721,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":268.19999998807907,"connectEnd":268.19999998807907,"connectStart":268.19999998807907,"domainLookupEnd":268.19999998807907,"domainLookupStart":268.19999998807907,"fetchStart":268.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":344.5,"responseEnd":369.7999999523163,"responseStart":366.2999999523163,"secureConnectionStart":268.19999998807907},{"duration":74.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":268.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":342.5,"responseStart":0,"secureConnectionStart":0},{"duration":103.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":268.5999999642372,"connectEnd":268.5999999642372,"connectStart":268.5999999642372,"domainLookupEnd":268.5999999642372,"domainLookupStart":268.5999999642372,"fetchStart":268.5999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":348.19999998807907,"responseEnd":372.0999999642372,"responseStart":371,"secureConnectionStart":268.5999999642372},{"duration":299.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":271.89999997615814,"connectEnd":271.89999997615814,"connectStart":271.89999997615814,"domainLookupEnd":271.89999997615814,"domainLookupStart":271.89999997615814,"fetchStart":271.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":398.39999997615814,"responseEnd":571.7999999523163,"responseStart":564.2999999523163,"secureConnectionStart":271.89999997615814},{"duration":301.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":271.89999997615814,"connectEnd":271.89999997615814,"connectStart":271.89999997615814,"domainLookupEnd":271.89999997615814,"domainLookupStart":271.89999997615814,"fetchStart":271.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":449.7999999523163,"responseEnd":573.5999999642372,"responseStart":567.7999999523163,"secureConnectionStart":271.89999997615814},{"duration":123.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":613.5,"connectEnd":613.5,"connectStart":613.5,"domainLookupEnd":613.5,"domainLookupStart":613.5,"fetchStart":613.5,"redirectEnd":0,"redirectStart":0,"requestStart":703.3999999761581,"responseEnd":737.3999999761581,"responseStart":736.6999999880791,"secureConnectionStart":613.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":55,"responseStart":259,"responseEnd":268,"domLoading":262,"domInteractive":1060,"domContentLoadedEventStart":1060,"domContentLoadedEventEnd":1109,"domComplete":1720,"loadEventStart":1720,"loadEventEnd":1720,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1037},{"name":"bigPipe.sidebar-id.end","time":1037.699999988079},{"name":"bigPipe.activity-panel-pipe-id.start","time":1037.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1040.2999999523163},{"name":"activityTabFullyLoaded","time":1129.8999999761581}],"measures":[],"correlationId":"fcfe645f943508","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":132,"dbReadsTimeInMs":18,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}