MariaDB allows storage engines to define additional attributes per index, field, or table. However, per-table attributes cannot be specified per partition. We should support per-partition attributes for more flexible configurations. Also, this functionality is necessary for other important features (see the issue links below). https://mariadb.com/kb/en/engine-defined-new-tablefieldindex-attributes/
Syntax
partition_definition:
PARTITION partition_name
[VALUES {LESS THAN {(expr) | MAXVALUE} | IN (value_list)}]
Here is a possible use case of the per-partition attributes support. By the use of per-partition attributes, the Spider storage engine (and other federated engines) can provide users with a cleaner way to specify where to connect.
CREATETABLE tbl_a (
a INT,
b VARCHAR(255),
PRIMARYKEY(a)
) ENGINE=Spider PARTITION BY RANGE(a) (
PARTITION pt1 VALUES LESS THAN (100) REMOTE_SERVER="s_2_1" REMOTE_TABLE="ta_r1",
PARTITION pt2 VALUES LESS THAN MAXVALUE REMOTE_SERVER="s_2_1", REMOTE_TABLE="ta_r2"
)
Note that the example above doesn't work with the current server implementation.
Description
If an engine-defined attribute is specified at table-level, it applies to all the partitions in the table (backward compatible behavior).
Specifying an engine-defined attribute at table-level is only possible when all the storage engines composing a partitioned table support this attribute. Currently, it is not possible to use multiple storage engines to create a partitioned table, but this will be possible in MDEV-22168.
One can use both per-table attributes and per-partition attributes for a single table. If the same attribute is specified both at table-level and partition-level, the per-partition attribute takes precedence. So, we can consider per-table attributes as default values.
We do not support, at least in the present issue, engine-defined attributes per subpartitions.
TODO
Modify the parser to accept per-partition attributes;
Keep per-partition attributes some in-memory data structure (class partition_element ?);
Pass per-partition attributes to ha_partition::create() as per-table attributes;
This is to keep the handler mostly oblivious whether it's a partition or a table.
10.8.0-dbg>CREATE TABLE t1 (a INT,b VARCHAR(255),PRIMARY KEY(a)) ENGINE=MyISAM PARTITION BY RANGE(a) (
-> PARTITION pt1 VALUES LESS THAN (100) ENGINE=InnoDB,
-> PARTITION pt2 VALUES LESS THAN MAXVALUE ENGINE=InnoDB);
ERROR 1497 (HY000): The mix of handlers in the partitions is not allowed in this version of MariaDB
Roel Van de Paar
added a comment - - edited Note that mixing of SE's is not implemented yet (planned in MDEV-22168 ):
10.8.0 959a6a723f6b6fb6d9630380c2317b8d51f9e4d8 (Debug)
10.8.0-dbg>CREATE TABLE t1 (a INT,b VARCHAR(255),PRIMARY KEY(a)) ENGINE=MyISAM PARTITION BY RANGE(a) (
-> PARTITION pt1 VALUES LESS THAN (100) ENGINE=InnoDB,
-> PARTITION pt2 VALUES LESS THAN MAXVALUE ENGINE=InnoDB);
ERROR 1497 (HY000): The mix of handlers in the partitions is not allowed in this version of MariaDB
OK to push. However, I am still running a generic crash test against the feature branch. Results from that will be available around next week Wednesday.
Roel Van de Paar
added a comment - OK to push. However, I am still running a generic crash test against the feature branch. Results from that will be available around next week Wednesday.
People
Nayuta Yanagisawa (Inactive)
Sergei Golubchik
Votes:
6Vote for this issue
Watchers:
14Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":924,"ttfb":288.39999985694885,"pageVisibility":"visible","entityId":26344,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"cea12b42-6c66-4fd8-8bff-184ebc75f7dc","navigationType":0,"readyForUser":1067,"redirectCount":0,"resourceLoadedEnd":1496.3999998569489,"resourceLoadedStart":293.2000000476837,"resourceTiming":[{"duration":113.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":293.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.5,"responseStart":0,"secureConnectionStart":0},{"duration":113.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":293.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":293.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":122.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":293.7000000476837,"connectEnd":293.7000000476837,"connectStart":293.7000000476837,"domainLookupEnd":293.7000000476837,"domainLookupStart":293.7000000476837,"fetchStart":293.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":293.7000000476837,"responseEnd":415.89999985694885,"responseStart":415.89999985694885,"secureConnectionStart":293.7000000476837},{"duration":180.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":293.7999999523163,"connectEnd":293.7999999523163,"connectStart":293.7999999523163,"domainLookupEnd":293.7999999523163,"domainLookupStart":293.7999999523163,"fetchStart":293.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":293.7999999523163,"responseEnd":473.89999985694885,"responseStart":473.89999985694885,"secureConnectionStart":293.7999999523163},{"duration":183.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":294,"connectEnd":294,"connectStart":294,"domainLookupEnd":294,"domainLookupStart":294,"fetchStart":294,"redirectEnd":0,"redirectStart":0,"requestStart":294,"responseEnd":477.89999985694885,"responseStart":477.89999985694885,"secureConnectionStart":294},{"duration":183.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":294.2999999523163,"connectEnd":294.2999999523163,"connectStart":294.2999999523163,"domainLookupEnd":294.2999999523163,"domainLookupStart":294.2999999523163,"fetchStart":294.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":294.2999999523163,"responseEnd":478.2000000476837,"responseStart":478.2000000476837,"secureConnectionStart":294.2999999523163},{"duration":184.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":294.39999985694885,"connectEnd":294.39999985694885,"connectStart":294.39999985694885,"domainLookupEnd":294.39999985694885,"domainLookupStart":294.39999985694885,"fetchStart":294.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":294.39999985694885,"responseEnd":478.59999990463257,"responseStart":478.59999990463257,"secureConnectionStart":294.39999985694885},{"duration":273.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":294.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":294.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":568,"responseStart":0,"secureConnectionStart":0},{"duration":184.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":294.7999999523163,"connectEnd":294.7999999523163,"connectStart":294.7999999523163,"domainLookupEnd":294.7999999523163,"domainLookupStart":294.7999999523163,"fetchStart":294.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":294.7999999523163,"responseEnd":479,"responseStart":479,"secureConnectionStart":294.7999999523163},{"duration":273.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":295,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":568.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":184.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":295.2000000476837,"connectEnd":295.2000000476837,"connectStart":295.2000000476837,"domainLookupEnd":295.2000000476837,"domainLookupStart":295.2000000476837,"fetchStart":295.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":295.2000000476837,"responseEnd":479.7000000476837,"responseStart":479.7000000476837,"secureConnectionStart":295.2000000476837},{"duration":389.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":302.59999990463257,"connectEnd":302.59999990463257,"connectStart":302.59999990463257,"domainLookupEnd":302.59999990463257,"domainLookupStart":302.59999990463257,"fetchStart":302.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":302.59999990463257,"responseEnd":691.7000000476837,"responseStart":691.7000000476837,"secureConnectionStart":302.59999990463257},{"duration":1192,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":303.39999985694885,"connectEnd":303.39999985694885,"connectStart":303.39999985694885,"domainLookupEnd":303.39999985694885,"domainLookupStart":303.39999985694885,"fetchStart":303.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":303.39999985694885,"responseEnd":1495.3999998569489,"responseStart":1495.3999998569489,"secureConnectionStart":303.39999985694885},{"duration":113.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":579.7000000476837,"connectEnd":579.7000000476837,"connectStart":579.7000000476837,"domainLookupEnd":579.7000000476837,"domainLookupStart":579.7000000476837,"fetchStart":579.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":579.7000000476837,"responseEnd":693.2999999523163,"responseStart":693.2999999523163,"secureConnectionStart":579.7000000476837},{"duration":638.7999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":857.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":857.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1496.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":726,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":858.5999999046326,"connectEnd":858.5999999046326,"connectStart":858.5999999046326,"domainLookupEnd":858.5999999046326,"domainLookupStart":858.5999999046326,"fetchStart":858.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":858.5999999046326,"responseEnd":1584.5999999046326,"responseStart":1584.5999999046326,"secureConnectionStart":858.5999999046326},{"duration":734.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":859,"connectEnd":859,"connectStart":859,"domainLookupEnd":859,"domainLookupStart":859,"fetchStart":859,"redirectEnd":0,"redirectStart":0,"requestStart":859,"responseEnd":1593.5,"responseStart":1593.5,"secureConnectionStart":859}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":98,"responseStart":289,"responseEnd":303,"domLoading":292,"domInteractive":1532,"domContentLoadedEventStart":1532,"domContentLoadedEventEnd":1582,"domComplete":2363,"loadEventStart":2363,"loadEventEnd":2363,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1499.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1500.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1500.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1501.8999998569489},{"name":"activityTabFullyLoaded","time":1602.3999998569489}],"measures":[],"correlationId":"8675d0f7d48a1f","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":125,"dbReadsTimeInMs":24,"dbConnsTimeInMs":34,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Ok to push as discussed on Slack.