Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL)
-
None
Description
When we need to add/remove or change LIMIT, INTERVAL, AUTO we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
alter table t1 partition by system_time; |
The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning.
Examples:
create or replace table t1 (x int) with system versioning |
partition by system_time limit 100 partitions 4; |
# Change LIMIT
|
alter table t1 partition by system_time limit 33; |
# Remove LIMIT
|
alter table t1 partition by system_time; |
# This does full repartitioning |
alter table t1 partition by system_time limit 33 partitions 4; |
# This does data copy as pruning will require records in correct partitions |
alter table t1 partition by system_time interval 1 hour |
starts '2000-01-01 00:00:00'; |
# But this works fast, LIMIT will apply to DML commands |
alter table t1 partition by system_time limit 33; |
Attachments
Issue Links
- is blocked by
-
MDEV-19903 Setup default partitions for system versioning
-
- Closed
-
- is duplicated by
-
MDEV-25540 Auto-create: There is no clear way to disable auto-creation without ruining existing partitions
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
alter table t1 partition by system_time; The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
Component/s | Partitioning [ 10802 ] | |
Component/s | Versioned Tables [ 14303 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.8 [ 26121 ] | |
Assignee | Aleksey Midenkov [ midenok ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Link |
This issue is duplicated by |
Description |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does full repartitioning alter table t1 partition by system_time limit 33 partitions 6; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
Description |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does full repartitioning alter table t1 partition by system_time limit 33 partitions 6; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does full repartitioning alter table t1 partition by system_time limit 33 partitions 4; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
Summary | ALTER of SYSTEM_TIME partitioning is not possible without data copy | Change of SYSTEM_TIME partitioning options is not possible without data copy |
Fix Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.3 [ 22126 ] |
Assignee | Aleksey Midenkov [ midenok ] | Nikita Malyavin [ nikitamalyavin ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Link |
This issue is blocked by |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] |
Assignee | Nikita Malyavin [ nikitamalyavin ] | Aleksey Midenkov [ midenok ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Aleksey Midenkov [ midenok ] | Oleksandr Byelkin [ sanja ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Aleksey Midenkov [ midenok ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Description |
When we need to add/remove or change LIMIT, INTERVAL, AUTO (10.8 and more) we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does full repartitioning alter table t1 partition by system_time limit 33 partitions 4; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
When we need to add/remove or change LIMIT, INTERVAL, AUTO we have to recreate partitioning from scratch. Such operations should be done fast. To remove options like LIMIT or INTERVAL one should write:
{code:sql} alter table t1 partition by system_time; {code} The command checks whether it is new or existing SYSTEM_TIME partitioning. And in the case of new it behaves as CREATE would do: adds default number of partitions (2). If SYSTEM_TIME partitioning already existed it just changes its options: removes unspecified ones and adds/changes those specified explicitly. In case when partitions list was supplied it behaves as usual: does full repartitioning. Examples: {code:sql} create or replace table t1 (x int) with system versioning partition by system_time limit 100 partitions 4; # Change LIMIT alter table t1 partition by system_time limit 33; # Remove LIMIT alter table t1 partition by system_time; # This does full repartitioning alter table t1 partition by system_time limit 33 partitions 4; # This does data copy as pruning will require records in correct partitions alter table t1 partition by system_time interval 1 hour starts '2000-01-01 00:00:00'; # But this works fast, LIMIT will apply to DML commands alter table t1 partition by system_time limit 33; {code} |
Fix Version/s | 10.8.1 [ 26815 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Assignee | Aleksey Midenkov [ midenok ] | Geoff Montee [ geoffmontee ] |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.8.1 [ 26815 ] |
Assignee | Geoff Montee [ geoffmontee ] | Aleksey Midenkov [ midenok ] |
Fix Version/s | 10.9.1 [ 27114 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Please review bb-10.5-midenok