|
1 | 1 | # MyRocks limitations |
2 | 2 |
|
3 | | -Compared to InnoDB, the MyRocks storage engine lacks the following features: |
| 3 | +## Online DDL limitations |
4 | 4 |
|
5 | | -* MyRocks has limited support for [Online DDL operations](https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl.html) due to the lack of atomic DDL. As a result the schema changes are more restricted compared to InnoDB. |
| 5 | +MyRocks has limited support for [Online DDL operations](https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl.html) due to the lack of atomic DDL. As a result the schema changes are more restricted compared to InnoDB. |
6 | 6 |
|
7 | | - * `Traditional MyRocks DDL behavior` |
| 7 | +### Traditional MyRocks DDL behavior |
8 | 8 |
|
9 | | - | Operation type | Examples | ALGORITHM | |
10 | | - |---------------------|--------------------------------------------------|-----------------------------| |
11 | | - | Index operations | `ADD INDEX`, `DROP INDEX`, `RENAME INDEX` | `INPLACE` (always) | |
12 | | - | Column changes | `ADD COLUMN`, `DROP COLUMN`, `MODIFY COLUMN` | `COPY` (full table rebuild) | |
13 | | - | Metadata changes | `RENAME TABLE`, some `RENAME COLUMN` operations | May be `INSTANT` | |
| 9 | +| Operation type | Examples | ALGORITHM | |
| 10 | +|---------------------|--------------------------------------------------|-----------------------------| |
| 11 | +| Index operations | `ADD INDEX`, `DROP INDEX`, `RENAME INDEX` | `INPLACE` (always) | |
| 12 | +| Column changes | `ADD COLUMN`, `DROP COLUMN`, `MODIFY COLUMN` | `COPY` (full table rebuild) | |
| 13 | +| Metadata changes | `RENAME TABLE`, some `RENAME COLUMN` operations | May be `INSTANT` | |
14 | 14 |
|
15 | | - **Note:** MyRocks does not support atomic DDL. Even metadata-only operations may require a full table rebuild, depending on the nature of the change. |
| 15 | +**Note:** MyRocks does not support atomic DDL. Even metadata-only operations may require a full table rebuild, depending on the nature of the change. |
16 | 16 |
|
17 | | - * As of `Percona Server for MySQL 8.0.25-15`, MyRocks supports `INPLACE` partition management for certain operations: |
| 17 | +### Partition management support |
18 | 18 |
|
19 | | - ```sql |
20 | | - ALTER TABLE t1 DROP PARTITION p1, ALGORITHM=INPLACE; |
21 | | - ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES LESS THAN (MAXVALUE)), ALGORITHM=INPLACE; |
22 | | - ``` |
23 | | - The aforementioned operations no longer require a full table rebuild. However, operations that modify partitioning schemes, such as changing `VALUES LESS THAN`, still fall back to the `COPY` algorithm. |
| 19 | +As of `Percona Server for MySQL 8.0.25-15`, MyRocks supports `INPLACE` partition management for certain operations: |
24 | 20 |
|
25 | | - **Note:** Dropping a partition permanently deletes any data stored in it unless that data is reassigned to another partition. |
| 21 | +```sql |
| 22 | +ALTER TABLE t1 DROP PARTITION p1, ALGORITHM=INPLACE; |
| 23 | +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES LESS THAN (MAXVALUE)), ALGORITHM=INPLACE; |
| 24 | +``` |
| 25 | +The aforementioned operations no longer require a full table rebuild. However, operations that modify partitioning schemes, such as changing `VALUES LESS THAN`, still fall back to the `COPY` algorithm. |
| 26 | + |
| 27 | +**Note:** Dropping a partition permanently deletes any data stored in it unless that data is reassigned to another partition. |
| 28 | + |
| 29 | +### Instant DDL support |
| 30 | + |
| 31 | +As of `Percona Server for MySQL 8.0.42-33`, MyRocks introduces limited support for Instant DDL, which is disabled by default and controlled via configuration variables. |
26 | 32 |
|
27 | | - |
28 | | - * As of `Percona Server for MySQL 8.0.42-33`, MyRocks introduces limited support for Instant DDL, which is disabled by default and controlled via configuration variables. |
| 33 | +To enable specific types of instant operations, use the following configuration options: |
29 | 34 |
|
30 | | - To enable specific types of instant operations, use the following configuration options: |
| 35 | +| Configuration variable | Enables Instant DDL for | ALGORITHM (internal only) | |
| 36 | +|------------------------|--------------------------|----------------------------| |
| 37 | +| [`rocksdb_enable_instant_ddl_for_append_column=ON`](variables.md#rocksdb_enable_instant_ddl_for_append_column) | `ALTER TABLE ... ADD COLUMN` | `INSTANT` | |
| 38 | +| [`rocksdb_enable_instant_ddl_for_column_default_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_column_default_changes) | `ALTER/MODIFY COLUMN … DEFAULT` | `INSTANT` | |
| 39 | +| [`rocksdb_enable_instant_ddl_for_drop_index_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_drop_index_changes) | `ALTER TABLE ... DROP INDEX` | `INSTANT` | |
| 40 | +| [`rocksdb_enable_instant_ddl_for_table_comment_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_table_comment_changes) | `ALTER TABLE ... COMMENT` | `INSTANT` | |
31 | 41 |
|
32 | | - | Configuration variable | Enables Instant DDL for | ALGORITHM (internal only) | |
33 | | - |------------------------|--------------------------|----------------------------| |
34 | | - | [`rocksdb_enable_instant_ddl_for_append_column=ON`](variables.md#rocksdb_enable_instant_ddl_for_append_column) | `ALTER TABLE ... ADD COLUMN` | `INSTANT` | |
35 | | - | [`rocksdb_enable_instant_ddl_for_column_default_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_column_default_changes) | `ALTER/MODIFY COLUMN … DEFAULT` | `INSTANT` | |
36 | | - | [`rocksdb_enable_instant_ddl_for_drop_index_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_drop_index_changes) | `ALTER TABLE ... DROP INDEX` | `INSTANT` | |
37 | | - | [`rocksdb_enable_instant_ddl_for_table_comment_changes=ON`](variables.md#rocksdb_enable_instant_ddl_for_table_comment_changes) | `ALTER TABLE ... COMMENT` | `INSTANT` | |
| 42 | +**Note:** MyRocks does **not support `ALGORITHM=INSTANT`** in SQL syntax. These operations behave like Instant DDL **internally**, but only if the respective configuration variables are enabled. |
38 | 43 |
|
39 | | - **Note:** MyRocks does **not support `ALGORITHM=INSTANT`** in SQL syntax. These operations behave like Instant DDL **internally**, but only if the respective configuration variables are enabled. |
| 44 | +## Unsupported InnoDB features in MyRocks |
40 | 45 |
|
41 | 46 | * [ALTER TABLE .. EXCHANGE PARTITION](https://dev.mysql.com/doc/refman/8.0/en/partitioning-management-exchange.html). |
42 | 47 |
|
|
0 commit comments