XUANWU_V2 engine
The AnalyticDB for MySQL XUANWU_V2 table engine provides high-throughput writes and queries with OSS-based storage and an independent compaction service.
Prerequisites
An AnalyticDB for MySQL Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster is created.
-
The minor version of the cluster is 3.2.2.0 or later.
NoteTo view and update the minor version, go to the Configuration Information section on the Cluster Information page in the AnalyticDB for MySQL console.
Key features
XUANWU_V2 enables AnalyticDB for MySQL to deliver high-throughput real-time writes and queries with these key features:
-
Storage medium: Data is stored in OSS with a cloud disk cache, reducing storage costs while maintaining query performance and enabling faster horizontal scaling and higher elasticity.
-
Storage format: A next-generation columnar format provides fine-grained control over memory and disk I/O, delivering higher I/O concurrency with lower memory consumption and reduced GC impact.
-
Independent compaction component: Compaction is offloaded to an independent service, improving online query and write stability while providing higher compaction throughput and flexible resource scheduling.
Limitations
-
The following table compares feature support between the XUANWU and XUANWU_V2 engines.
Feature
XUANWU engine
XUANWU_V2 engine
regular index
By default, a full-column index is created (
INDEX_ALL='Y').By default, XUANWU_V2 creates an index only for the primary key. No indexes are created for other columns (
INDEX_ALL='N').NoteYou can create or modify a full-column index in one of the following ways:
-
Before you create a table: Run the
SET ADB_CONFIG XUANWUV2_DEFAULT_INDEX_ALL=truestatement at the cluster level. This creates a full-column index for the current table and all subsequent new tables. -
When you create a table: Explicitly specify
INDEX_ALL='Y'in the CREATE TABLE statement. This creates a full-column index for the current table. -
After you create a table: Run an ALTER TABLE statement to modify the full-column index of an existing table.
Supported
Not supported
Supported
Not supported
Supported
Not supported
-
-
You cannot switch between the XUANWU and XUANWU_V2 engines. To switch, create a new table with the desired engine and migrate the data.
For example, to switch a
testtable from XUANWU_V2 to XUANWU, create a new XUANWU table and migrate the data fromtest.
Billing
By default, data in XUANWU_V2 tables is hot data and is billed based on the hot data storage space. If you enable tiered storage of hot and cold data, you are charged for both hot and cold data storage. Pricing for Enterprise Edition and Basic Edition and Pricing for Data Lakehouse Edition.
Log on to the AnalyticDB for MySQL console and go to the Storage Overview page to view XUANWU_V2 table storage. View the data size of a table.
Configure the table engine
For clusters with minor version 3.2.2.0 or later, XUANWU_V2 is the default table engine. You can override this at the cluster or table level.
Cluster-level configuration
Run the following command to set the default engine for the entire cluster:
SET ADB_CONFIG RC_DDL_ENGINE_REWRITE_XUANWUV2=false|true;
Valid values:
-
true(default): Existing tables are unchanged. New tables use XUANWU_V2 even if you specifyENGINE=XUANWU.NoteTo create a XUANWU table, add the
/* RC_DDL_ENGINE_REWRITE_XUANWUV2=false */hint beforeCREATE TABLE. -
false: Existing tables are unchanged. New tables default to XUANWU. To create a XUANWU_V2 table, specifyENGINE=XUANWU_V2or add the/* RC_DDL_ENGINE_REWRITE_XUANWUV2=true */hint beforeCREATE TABLE.
Query the current configuration:
SHOW ADB_CONFIG KEY=RC_DDL_ENGINE_REWRITE_XUANWUV2;
Table-level configuration
Table-level configurations are supported only on clusters with minor version 3.2.2.12 or later (excluding minor versions 3.2.3.1 and 3.2.3.2).
A table-level hint applies only to the current CREATE TABLE statement and overrides the cluster-level setting.
/* RC_DDL_ENGINE_REWRITE_XUANWUV2=false|true */
Valid values:
-
true: Existing tables are unchanged. The table created by this statement uses XUANWU_V2 even if you specifyENGINE=XUANWU. -
false: Existing tables are unchanged. The table created by this statement uses XUANWU by default. To use XUANWU_V2, specifyENGINE=XUANWU_V2.
Enable the disk cache
After you enable the disk cache, the cluster automatically restarts. This may cause transient disconnections. We recommend that you perform this operation during off-peak hours and ensure that your application has an automatic reconnection mechanism.
XUANWU_V2 cold data is stored in OSS. The disk cache improves random read performance for cold data. You are charged for the configured cache space.
Do not disable the disk cache after enabling it. Doing so may cause severe performance degradation.
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
-
On the Cluster Information page, in the Configuration Information section, click Configure next to Cluster Query Acceleration Configuration.
-
On the Disk Cache tab, click the
switch and set the cache size.
After you enable the Disk Cache, you can also follow the preceding steps to view the cache size.
Enable the compaction service
The compaction service offloads compaction to an independent resource pool, reducing online resource consumption and improving stability. This optional feature is disabled by default, billed pay-as-you-go, and can be disabled at any time. Pricing for Enterprise Edition and Basic Edition and Pricing for Data Lakehouse Edition.
Recommended for services with:
-
High online CPU and memory utilization.
-
Performance significantly affected by periodic compaction.
Procedure
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. Find the cluster that you want to manage and click the cluster ID.
-
On the Cluster Information page, in the Configuration Information section, click Configure next to Cluster Query Acceleration Configuration.
-
On the Remote Build tab, click the
switch to enable the service.