diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2020-02-25 14:14:17 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2020-02-25 15:43:23 +0300 |
commit | f707c83fff4fa3f5291684e6226542fdb75bbdeb (patch) | |
tree | 1a554d5f3f27e38a7a2d78819207ddd0c6ea8514 /sql/table.h | |
parent | c12609dd9ed65b245cee2e8b379b1e1f15aadf6a (diff) | |
download | mariadb-git-f707c83fff4fa3f5291684e6226542fdb75bbdeb.tar.gz |
MDEV-17554 Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT
When there are E empty partitions left, auto-create N new empty
partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and
marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT
keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL
clause.
CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT;
CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT;
The current revision implements hard-coded values of 1 for E and N. As
well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000.
The name for newly added partition will be first chosen as "pX", where
X is partition number and "p" is hard-coded name prefix. If this name
is already occupied, the X will be incremented until the resulting
name will be free to use.
ALTER TABLE ADD PARTITION is now always fast. If there some history
partition overflow occurs manual ALTER TABLE REBUILD PARTITION is
needed.
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h index 6ce92ee048e..50ac46fbe39 100644 --- a/sql/table.h +++ b/sql/table.h @@ -800,6 +800,9 @@ struct TABLE_SHARE uint partition_info_str_len; uint partition_info_buffer_size; plugin_ref default_part_plugin; + bool vers_altering; + time_t vers_hist_part_timeout; + uint vers_hist_part_error; #endif /** |