PolarDB-X is highly compatible with the MySQL protocol and SQL syntax. Because PolarDB-X is a distributed database, some MySQL features behave differently or are not supported. Review these limits before you start development or migrate an existing application.
Limits on common identifiers
| Identifier | Maximum length | Allowed characters |
|---|---|---|
| Database | 32 | Uppercase and lowercase letters, digits, and underscores (_) |
| Sequence | 128 | Unicode characters |
| Partition | 16 | — |
| Table | 64 | — |
| Column | — | — |
| Partition key | — | — |
| View | — | — |
| Variables | — | — |
| Constraint | — | — |
Limits on resource usage
Logical resources
| Resource | Limit |
|---|---|
| Databases per cluster | 32 |
| Tables per database | 8,192 |
| Partitions per table | 8,192 |
| Columns per table | 1,017 |
| Sequences per database | 16,384 |
| Views per database | 8,192 |
| Global indexes per table | 32 |
| Users per database | 2,048 (username: 255 characters maximum) |
Physical resources
| Resource | Default limit |
|---|---|
| Connections per compute node | 20,000 |
| Compute nodes added at a time | 99. To add more nodes at a time, contact Alibaba Cloud technical support. |
| Storage nodes added at a time | — |
Limits on SQL syntax
Some limits are architectural constraints of distributed systems. Others are planned for future releases.
Unsupported features
The following MySQL features are not supported in PolarDB-X.
Custom operations
| Feature | Notes |
|---|---|
| Custom data type | Not supported |
| Trigger | Not supported |
DDL
| Statement | Notes |
|---|---|
CREATE TABLE ... LIKE ... | Partitioned tables are not supported |
CREATE TABLE ... SELECT ... | Partitioned tables are not supported |
MERGE, SPLIT, ADD, and DROP on subpartition tables | Not supported |
MERGE, SPLIT, ADD, and DROP on partitioned index tables | Not supported |
DML
| Statement | Notes |
|---|---|
STRAIGHT_JOIN | Not supported |
NATURAL JOIN | Not supported |
INSERT DELAYED | Not supported |
Variable references and operations (for example, SET @c=1, @d=@c+1; SELECT @c, @d) | Not supported |
LOAD XML | Not supported |
DQL
| Statement | Notes |
|---|---|
Subqueries in a HAVING clause | Not supported |
Subqueries in a JOIN ... ON clause | Not supported |
Database management
| Statement | Notes |
|---|---|
SHOW WARNINGS | The LIMIT and COUNT combination is not supported |
SHOW ERRORS | The LIMIT and COUNT combination is not supported |
HELP | Not supported |
Operators
| Operator | Notes |
|---|---|
:= | Not supported |
Functions
| Function | Notes |
|---|---|
| Full-text search functions | Not supported |
| XML functions | Not supported |
| Functions for global transaction identifiers | Not supported |
Data types
| Type | Notes |
|---|---|
Spatial data types (GEOMETRY, LINESTRING) | Not supported |
| JSON data type | Supported, but cannot be used as a partition key |
Keywords
| Keyword | Notes |
|---|---|
MILLISECOND | Not supported |
MICROSECOND | Not supported |
Supported features
The following custom operations and DDL statements are supported:
| Feature | Notes |
|---|---|
| User-defined function | Supported |
| Stored procedure | Supported |
| Cursor | Supported |
| View | Supported |
CREATE TABLE ... Generated Column ... | Supported |
RENAME TABLE | Supported |
ALTER TABLE | Supported |
| Foreign key | Supported |
| Subquery as scalar operand | Supported |
Behavior differences from MySQL
The following statements are supported but behave differently from standard MySQL.
UPDATE with ON UPDATE CURRENT_TIMESTAMP
In PolarDB-X, every logical UPDATE sets a column with the ON UPDATE CURRENT_TIMESTAMP attribute to the current timestamp, regardless of whether any other column changed. In MySQL, the column is only updated if at least one other column changes.
Example
-- Create a table with an ON UPDATE CURRENT_TIMESTAMP column
CREATE TABLE t (
id INT PRIMARY KEY,
name VARCHAR(50),
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO t VALUES (1, 'Alice', NOW());
-- Update with no actual data change
UPDATE t SET name = 'Alice' WHERE id = 1;
-- PolarDB-X: updated_at is refreshed to CURRENT_TIMESTAMP
-- MySQL: updated_at is NOT refreshed (no data changed)
SELECT id, name, updated_at FROM t WHERE id = 1;If your application logic relies on MySQL's behavior of leaving updated_at unchanged when no data changes, update your queries or application code before migrating to PolarDB-X.