Skip to content

Extend alter table query templates with enable auto split #1800

@antonkovalenko

Description

@antonkovalenko

Every time users need to enable auto partitioning by load we have to search required queries on the internets.

Let's introduce second level under alter table and add two options:

  • Rename, Manage columns -> this menu item fills the editor with current query template, available under alter table command
  • Manage auto partitioning -> this one fills the editor with the query template written below.

Query template for manage partitioning


-- documentation about partitioning https://ydb.tech/docs/en/concepts/datamodel/table#partitioning

ALTER TABLE `category` SET 
(
    AUTO_PARTITIONING_BY_LOAD = ENABLED, -- If a partition consumes more than 50% of the CPU for a few dozens of seconds, it is enqueued for splitting.
    AUTO_PARTITIONING_BY_SIZE = ENABLED, --  If a partition size exceeds the value specified by the AUTO_PARTITIONING_PARTITION_SIZE_MB  parameter, it is enqueued for splitting.
    AUTO_PARTITIONING_PARTITION_SIZE_MB = 2048,
    AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 10, -- Partitions are merged only if their actual number exceeds the value specified by this parameter.
    AUTO_PARTITIONING_MAX_PARTITIONS_COUNT = 100 -- Partitions are split only if their number doesn't exceed the value specified by this parameter.
)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions