Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17554

Auto-create new partition for system versioned tables with history partitioned by INTERVAL/LIMIT

    XMLWordPrintable

    Details

      Description

      When there are E empty partitions left, auto-create N new empty partitions.

      This scheme must not allow partition overflow. I.e. E-fill time must not exceed N-creation time. This means that low values for INTERVAL and LIMIT must not be allowed for auto-creation. In case when overflow is detected there is no need to do anything special: a warning will be issued and the user will run manual rebuild to redistribute records correctly. This is important because automatic ADD must be done fast, without forced rebuild, by the obvious reason.

      Initial version 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.

      Auto-creation mechanism is applied to every table having LIMIT or INTERVAL clause. Note that there is no much sense in specifying explicit partition list in this case and this is covered by MDEV-19903. The syntax to explicitly turn it on/off as well as user-defined values for E, N and name prefix is subject for further discussion and feature requests.

      ALTER TABLE ADD PARTITION is now always fast. If there some history partition overflow occurs manual ALTER TABLE REBUILD PARTITION is needed.

      More info

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              midenok Aleksey Midenkov
              Reporter:
              umoser Ulrich Moser
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: