Starting from this revision, MariaDB 10.3+ allows partitioning by range of a decimal column:
commit c3f35ea55a7150b186284e2ef717d12e6f81e13e
|
Author: Aleksey Midenkov
|
Date: Wed Aug 28 11:57:16 2019 +0300
|
|
MDEV-18501 Partition pruning doesn't work for historical queries (refactoring)
|
|
SYSTEM_TYPE partitioning: COLUMN properties removed. Partitioning is
|
now pure RANGE based on UNIX_TIMESTAMP(row_end).
|
|
DECIMAL type is now allowed as RANGE partitioning, we can partition by
|
UNIX_TIMESTAMP() (but not for DATETIME which depends on local timezone
|
of course).
|
However, the behavior looks strange.
MariaDB [test]> create or replace table t (d decimal(2,1)) partition by range (d) (partition p1 values less than (10), partition p2 values less than (20));
|
Query OK, 0 rows affected (0.690 sec)
|
|
MariaDB [test]> insert into t values (9.9);
|
Query OK, 1 row affected (0.049 sec)
|
|
MariaDB [test]> select * from t partition (p1);
|
Empty set (0.000 sec)
|
|
MariaDB [test]> select * from t partition (p2);
|
+------+
|
| d |
|
+------+
|
| 9.9 |
|
+------+
|
1 row in set (0.000 sec)
|
or another way to put it,
MariaDB [test]> create or replace table t (d decimal(2,1)) partition by range (d) (partition p1 values less than (10));
|
Query OK, 0 rows affected (0.639 sec)
|
|
MariaDB [test]> insert into t values (9.9);
|
ERROR 1526 (HY000): Table has no partition for value 10
|
Obviously, it temporarily rounds the value before finding a partition, but I don't think the outcome is reasonable. I couldn't find any documentation, either in MariaDB KB or in the version of SQL standard which I have access to on how it should really behave (and MySQL doesn't support it even in 8.0, so can't compare with it either).
- is caused by
-
MDEV-18501
Partition pruning doesn't work for historical queries
-
-
Closed
{"report":{"fcp":817,"ttfb":124.79999995231628,"pageVisibility":"visible","entityId":80827,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5cf0d2bc-fa8b-4186-9c16-b1113aa0ed8b","navigationType":0,"readyForUser":878.2999999523163,"redirectCount":0,"resourceLoadedEnd":1029.8999998569489,"resourceLoadedStart":139.39999985694885,"resourceTiming":[{"duration":244.79999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":139.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":139.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":384.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":244.60000014305115,"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":139.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":139.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":384.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":253.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":139.69999980926514,"connectEnd":139.69999980926514,"connectStart":139.69999980926514,"domainLookupEnd":139.69999980926514,"domainLookupStart":139.69999980926514,"fetchStart":139.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":139.69999980926514,"responseEnd":393.5,"responseStart":393.5,"secureConnectionStart":139.69999980926514},{"duration":279,"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":139.79999995231628,"connectEnd":139.79999995231628,"connectStart":139.79999995231628,"domainLookupEnd":139.79999995231628,"domainLookupStart":139.79999995231628,"fetchStart":139.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":139.79999995231628,"responseEnd":418.7999999523163,"responseStart":418.7999999523163,"secureConnectionStart":139.79999995231628},{"duration":282.7999999523163,"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":140,"connectEnd":140,"connectStart":140,"domainLookupEnd":140,"domainLookupStart":140,"fetchStart":140,"redirectEnd":0,"redirectStart":0,"requestStart":140,"responseEnd":422.7999999523163,"responseStart":422.7999999523163,"secureConnectionStart":140},{"duration":283.2999999523163,"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":140,"connectEnd":140,"connectStart":140,"domainLookupEnd":140,"domainLookupStart":140,"fetchStart":140,"redirectEnd":0,"redirectStart":0,"requestStart":140,"responseEnd":423.2999999523163,"responseStart":423.2999999523163,"secureConnectionStart":140},{"duration":283.40000009536743,"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":140.09999990463257,"connectEnd":140.09999990463257,"connectStart":140.09999990463257,"domainLookupEnd":140.09999990463257,"domainLookupStart":140.09999990463257,"fetchStart":140.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":140.09999990463257,"responseEnd":423.5,"responseStart":423.5,"secureConnectionStart":140.09999990463257},{"duration":283.80000019073486,"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":140.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":140.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":424,"responseStart":0,"secureConnectionStart":0},{"duration":283.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":140.29999995231628,"connectEnd":140.29999995231628,"connectStart":140.29999995231628,"domainLookupEnd":140.29999995231628,"domainLookupStart":140.29999995231628,"fetchStart":140.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":140.29999995231628,"responseEnd":424.09999990463257,"responseStart":424.09999990463257,"secureConnectionStart":140.29999995231628},{"duration":284.09999990463257,"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":140.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":140.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":424.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":284.19999980926514,"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":140.5,"connectEnd":140.5,"connectStart":140.5,"domainLookupEnd":140.5,"domainLookupStart":140.5,"fetchStart":140.5,"redirectEnd":0,"redirectStart":0,"requestStart":140.5,"responseEnd":424.69999980926514,"responseStart":424.69999980926514,"secureConnectionStart":140.5},{"duration":515.2999999523163,"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":141.09999990463257,"connectEnd":141.09999990463257,"connectStart":141.09999990463257,"domainLookupEnd":141.09999990463257,"domainLookupStart":141.09999990463257,"fetchStart":141.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":141.09999990463257,"responseEnd":656.3999998569489,"responseStart":656.3999998569489,"secureConnectionStart":141.09999990463257},{"duration":888.7000000476837,"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":141.19999980926514,"connectEnd":141.19999980926514,"connectStart":141.19999980926514,"domainLookupEnd":141.19999980926514,"domainLookupStart":141.19999980926514,"fetchStart":141.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":141.19999980926514,"responseEnd":1029.8999998569489,"responseStart":1029.8999998569489,"secureConnectionStart":141.19999980926514},{"duration":384.89999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":623.5,"connectEnd":623.5,"connectStart":623.5,"domainLookupEnd":623.5,"domainLookupStart":623.5,"fetchStart":623.5,"redirectEnd":0,"redirectStart":0,"requestStart":623.5,"responseEnd":1008.3999998569489,"responseStart":1008.3999998569489,"secureConnectionStart":623.5},{"duration":288.2999999523163,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":795.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":795.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1083.7999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":3,"responseStart":125,"responseEnd":127,"domLoading":137,"domInteractive":1068,"domContentLoadedEventStart":1068,"domContentLoadedEventEnd":1101,"domComplete":1750,"loadEventStart":1750,"loadEventEnd":1752,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1051.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1052.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1052.8999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":1055.0999999046326},{"name":"activityTabFullyLoaded","time":1107.3999998569489}],"measures":[],"correlationId":"aeb2218ecb1943","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":69,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}