-
Task
-
-
Major
-
Resolution:
Unresolved
-
-
-
This is about doing testing for MDEV-21829: Use packed sort keys in Unique objects
Packed Unique has these uses:
USE1: Histogram collection in EITS
USE2: agg_func(DISTINCT col,,, )
USE3: Index_merge stores rowids.
We need to test the scenario where the data doesn't fit into the in-memory Unique and is spilled on disk.
The focus is on the scenario where Unique stores variable-sized data, although it's nice to have a test for fixed-size data, too.
There is no way to turn off the new behavior. You will need to compare with the old server.
There is a bpftrace script to watch tempfile usage at MDEV-32472.
Variable-sized data
This is VARCHAR(n) columns.
(TODO: what happens with CHAR(n)?) cvicentiu ?
Controlling amount of memory that Unique uses
How much memory Unique will use for COUNT(DISTINCT): The logic is here:
size_t Item_sum::ram_limitation(THD *thd)
|
{
|
return MY_MAX(1024,
|
(size_t)MY_MIN(thd->variables.tmp_memory_table_size,
|
thd->variables.max_heap_table_size));
|
How much memory Unique will use in EITS ANALYZE:
void Column_statistics_collected::init(THD *thd, Field *table_field)
|
{
|
size_t max_heap_table_size= (size_t)thd->variables.max_heap_table_size;
|
Plan for test#1:
Create a table with VARCHAR column.
- Try different charsets (latin, utf8mb3, utf8mb4 if you have the data, ucs2)
- Try a few different collations (There's no need to try all collations)
Populate the table with enough random data of different lengths and chars.
Set @@max_heap_table_size low enough to force Unique to flush to disk.
Run
ANALYZE TABLE t PERSISTENT FOR COLUMNS (col) INDEXES ();
|
Compare the output of
select * from mysql.column_stats where db_name=datababase() and table_name='t'
|
with the server before the patch.
Also compare bpftrace tempfile usage output for both servers.
Testing for agg_func(DISTINCT ...)
TODO
- relates to
-
MDEV-21829
Use packed sort keys in Unique objects
-
-
Stalled
{"report":{"fcp":681.1000001430511,"ttfb":154.29999995231628,"pageVisibility":"visible","entityId":127383,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"bb4c0aee-6ff0-4717-b734-317252d2d707","navigationType":0,"readyForUser":784.5,"redirectCount":0,"resourceLoadedEnd":681.9000000953674,"resourceLoadedStart":159.79999995231628,"resourceTiming":[{"duration":6.1000001430511475,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":159.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":159.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":165.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":6.199999809265137,"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":160.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":160.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":166.29999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":89.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":160.20000004768372,"connectEnd":160.20000004768372,"connectStart":160.20000004768372,"domainLookupEnd":160.20000004768372,"domainLookupStart":160.20000004768372,"fetchStart":160.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":160.20000004768372,"responseEnd":249.60000014305115,"responseStart":249.60000014305115,"secureConnectionStart":160.20000004768372},{"duration":115.80000019073486,"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":160.29999995231628,"connectEnd":160.29999995231628,"connectStart":160.29999995231628,"domainLookupEnd":160.29999995231628,"domainLookupStart":160.29999995231628,"fetchStart":160.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":160.29999995231628,"responseEnd":276.10000014305115,"responseStart":276.10000014305115,"secureConnectionStart":160.29999995231628},{"duration":120,"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":160.40000009536743,"connectEnd":160.40000009536743,"connectStart":160.40000009536743,"domainLookupEnd":160.40000009536743,"domainLookupStart":160.40000009536743,"fetchStart":160.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":160.40000009536743,"responseEnd":280.40000009536743,"responseStart":280.40000009536743,"secureConnectionStart":160.40000009536743},{"duration":120.40000009536743,"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":160.5,"connectEnd":160.5,"connectStart":160.5,"domainLookupEnd":160.5,"domainLookupStart":160.5,"fetchStart":160.5,"redirectEnd":0,"redirectStart":0,"requestStart":160.5,"responseEnd":280.90000009536743,"responseStart":280.90000009536743,"secureConnectionStart":160.5},{"duration":120.59999990463257,"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":160.60000014305115,"connectEnd":160.60000014305115,"connectStart":160.60000014305115,"domainLookupEnd":160.60000014305115,"domainLookupStart":160.60000014305115,"fetchStart":160.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":160.60000014305115,"responseEnd":281.2000000476837,"responseStart":281.10000014305115,"secureConnectionStart":160.60000014305115},{"duration":120.90000009536743,"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":160.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":160.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":120.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":160.79999995231628,"connectEnd":160.79999995231628,"connectStart":160.79999995231628,"domainLookupEnd":160.79999995231628,"domainLookupStart":160.79999995231628,"fetchStart":160.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":160.79999995231628,"responseEnd":281.5,"responseStart":281.5,"secureConnectionStart":160.79999995231628},{"duration":121,"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":160.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":160.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":281.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":121,"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":161.10000014305115,"connectEnd":161.10000014305115,"connectStart":161.10000014305115,"domainLookupEnd":161.10000014305115,"domainLookupStart":161.10000014305115,"fetchStart":161.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":161.10000014305115,"responseEnd":282.10000014305115,"responseStart":282.10000014305115,"secureConnectionStart":161.10000014305115},{"duration":485,"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":166.20000004768372,"connectEnd":166.20000004768372,"connectStart":166.20000004768372,"domainLookupEnd":166.20000004768372,"domainLookupStart":166.20000004768372,"fetchStart":166.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":166.20000004768372,"responseEnd":651.2000000476837,"responseStart":651.2000000476837,"secureConnectionStart":166.20000004768372},{"duration":515.6000001430511,"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":166.29999995231628,"connectEnd":166.29999995231628,"connectStart":166.29999995231628,"domainLookupEnd":166.29999995231628,"domainLookupStart":166.29999995231628,"fetchStart":166.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":166.29999995231628,"responseEnd":681.9000000953674,"responseStart":681.7999999523163,"secureConnectionStart":166.29999995231628},{"duration":195.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":482.40000009536743,"connectEnd":482.40000009536743,"connectStart":482.40000009536743,"domainLookupEnd":482.40000009536743,"domainLookupStart":482.40000009536743,"fetchStart":482.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":482.40000009536743,"responseEnd":678,"responseStart":678,"secureConnectionStart":482.40000009536743},{"duration":28.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":658.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":658.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":687.2000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":28,"responseStart":154,"responseEnd":159,"domLoading":158,"domInteractive":844,"domContentLoadedEventStart":844,"domContentLoadedEventEnd":878,"domComplete":1539,"loadEventStart":1539,"loadEventEnd":1541,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":826.9000000953674},{"name":"bigPipe.sidebar-id.end","time":827.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":827.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":830.2000000476837},{"name":"activityTabFullyLoaded","time":886.2000000476837}],"measures":[],"correlationId":"2363df69b2acef","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":75,"dbReadsTimeInMs":11,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}