1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-09 08:01:34 +03:00
Files
mariadb/mysql-test/suite
Aleksey Midenkov 75ede427e4 MDEV-27328 Change of SYSTEM_TIME partitioning options is not possible without data copy
When we need to add/remove or change LIMIT, INTERVAL, AUTO we have to
recreate partitioning from scratch (via data copy). 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;

To sum up, ALTER for SYSTEM_TIME partitioning does full repartitioning
when:

  - INTERVAL was added or changed;
  - partition list or partition number was specified;

Otherwise it does fast alter table.

Cleaned up dead condition in set_up_default_partitions().

Reviewed by:

  Oleksandr Byelkin <sanja@mariadb.com>
  Nikita Malyavin <nikitamalyavin@gmail.com>
2022-05-06 10:45:17 +03:00
..
2022-04-28 15:54:03 +03:00
2022-04-27 10:43:00 +03:00
2022-04-28 15:54:03 +03:00
2022-04-28 15:54:03 +03:00
2022-04-27 10:43:00 +03:00
2022-03-29 16:16:21 +03:00
2022-04-27 10:43:00 +03:00
2022-04-28 15:54:03 +03:00
2022-04-27 10:43:00 +03:00
2022-04-12 09:26:02 +03:00
2022-03-30 09:34:07 +03:00
2022-04-28 15:54:03 +03:00
2022-04-27 10:43:00 +03:00
2022-04-27 10:43:00 +03:00
2022-04-27 10:43:00 +03:00
2022-03-22 17:12:15 +04:00
2022-04-06 13:00:09 +03:00
2022-04-28 15:54:03 +03:00
2022-04-26 18:59:40 +03:00
2022-04-26 18:59:40 +03:00
2022-04-28 15:54:03 +03:00