Limits
PolarDB for MySQL provides the columnstore index (IMCI) feature, which is designed to significantly accelerate analytical processing (AP) queries. To ensure that your SQL queries can be correctly accelerated by columnstore indexes and return expected results, review the supported scope and limits before you use this feature.
General limits
Before you use a columnstore index, make sure that your cluster environment and table schema meet the following basic requirements:
Storage engine: You can create columnstore indexes only for tables that use the
InnoDBstorage engine.Temporary tables: Columnstore indexes cannot be used to accelerate queries on temporary tables.
Virtual columns: You can create a columnstore index on a virtual column only when both of the following conditions are met:
Set the cluster parameter
imci_enable_virtual_columntoON.NoteThis parameter is at the SESSION level and cannot be modified in the console.
Do not specify
order_keywhen you create the columnstore index.
Virtual column types: You cannot create columnstore indexes for virtual columns of the Spatial type.
Multi-master cluster (Limitless): Before you can add a global columnstore index read-only node and use the columnstore index feature, first modify the cluster parameter
loose_polar_enable_imci_with_mmtoON.
SELECT statement limits
Columnstore indexes are used only to accelerate SELECT queries. If a query statement contains any of the following structures, the entire query cannot be accelerated by a columnstore index and falls back to row store execution:
A
SELECTstatement that contains a locking read, such asSELECT ... FOR UPDATEorSELECT ... FOR SHARE.A
SELECTstatement that contains a window function with a frame definition. For example, theOVER()clause usesROWS UNBOUNDED PRECEDING.SELECT time, subject, val, SUM(val) OVER ( PARTITION BY subject ORDER BY time ROWS UNBOUNDED PRECEDING --- window function frame definition; IMCI does not support it ) AS running_total FROM observations;A subquery appears in the
GROUP BYclause of aSELECTstatement. For example,SELECT SUM(a) FROM t1 GROUP BY (SELECT ... FROM ...) as some_subquery;A subquery appears in an
ORDER BYexpression of aSELECTstatement. For example,SELECT a FROM t1 ORDER BY (SELECT ... FROM ...) as some_subquery;The correlated item of a subquery appears in the
JOINclause'sONcondition of aSELECTstatement. For example,WHERE t1.a in (SELECT t2.a FROM t2 INNER JOIN t3 on t2.a = t3.a AND t2.b > t1.b);A subquery contains a window function, and its correlated item appears in the
HAVINGcondition of aSELECTstatement.A subquery contains
UNION, and its correlated item appears in one of theUNIONsubqueries of aSELECTstatement.
Expression and function limits
If a SELECT statement contains any unsupported expression or function, the entire query falls back to row store execution.
Comparison expressions
Expression | Supported by columnstore indexes | Description |
| If | |
| If | |
| If the input parameters include both the | |
| If | |
| If the input parameters include both the | |
| - |
String expressions
Expression | Supported by columnstore indexes | Description |
| - | |
| BOOLEAN MODE and NATURAL LANGUAGE MODE are supported. | |
| - | |
| When you use a columnstore index, only the one-parameter form is supported; the two-parameter form is not supported. |
Encryption and compression expressions
Expression | Supported by columnstore indexes |
| |
| |
| |
| |
| |
| |
| |
| |
|
JSON functions
Function | Supported by columnstore indexes |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Spatial functions
Function | Supported by columnstore indexes |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|