The In-Memory Column Index (IMCI) feature accelerates analytical processing (AP) queries in PolarDB for MySQL. Review the following limits before enabling IMCI to make sure your environment and queries are compatible.
General limits
| Constraint | Details |
|---|---|
| Storage engine | InnoDB only. Columnstore indexes are not supported for tables that use other storage engines. |
| Temporary tables | Not supported. IMCI cannot accelerate queries on temporary tables. |
| Virtual columns | Supported when both conditions are met: imci_enable_virtual_column is set to ON, and order_key is not specified when creating the index. |
| Virtual columns — Spatial type | Not supported. You cannot create a columnstore index on a virtual column of the Spatial type. |
| Multi-master Cluster (Limitless) Edition | Set the cluster parameter loose_polar_enable_imci_with_mm to ON, then add a global read-only node for IMCI. |
imci_enable_virtual_column is a SESSION-level parameter and cannot be modified in the console.
SELECT statement limits
Columnstore indexes only accelerate SELECT queries. If a query contains any of the following structures, the query cannot be accelerated by the columnstore index and will fall back to row store execution:
Locking reads:
SELECT ... FOR UPDATEorSELECT ... FOR SHAREA window function with a frame definition — for example,
ROWS UNBOUNDED PRECEDINGin theOVER()clause:SELECT time, subject, val, SUM(val) OVER ( PARTITION BY subject ORDER BY time ROWS UNBOUNDED PRECEDING -- Frame definition not supported by IMCI ) AS running_total FROM observations;A subquery in the
GROUP BYclause — for example,SELECT SUM(a) FROM t1 GROUP BY (SELECT ... FROM ...) as some_subqueryA subquery in an
ORDER BYexpression — for example,SELECT a FROM t1 ORDER BY (SELECT ... FROM ...) as some_subqueryA correlated subquery in the
ONcondition of aJOIN— 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 that contains a window function, where a correlated item appears in the
HAVINGconditionA subquery that contains a
UNION, where a correlated item appears in one of theUNIONsubqueries
Expression and function limits
If a SELECT statement includes any unsupported expression or function, the entire query falls back to row store execution.
Comparison expressions
| Expression | Supported | Notes |
|---|---|---|
BETWEEN ... AND ... | Yes | If b and c have different data types in a BETWEEN b AND c, results may differ from row store execution. |
NOT BETWEEN ... AND ... | Yes | If b and c have different data types in a NOT BETWEEN b AND c, results may differ from row store execution. |
GREATEST() | Yes | If input parameters include both a TIME type and a string type, results may differ from row store execution. |
IN() | Yes | If expr0, expr1, ... have different data types in IN(expr0, expr1, ...), results may differ from row store execution. |
LEAST() | Yes | If input parameters include both a TIME type and a string type, results may differ from row store execution. |
SOUNDS LIKE | No | — |
String expressions
| Expression | Supported | Notes |
|---|---|---|
MATCH | Yes | BOOLEAN MODE and NATURAL LANGUAGE MODE are supported. |
TIMESTAMP() | Yes | Only the single-parameter form is supported. The two-parameter form is not supported. |
SOUNDEX() | No | — |
LOAD_FILE() | No | — |
Unsupported expressions and functions
The following expressions and functions are not supported by columnstore indexes.
Encryption and compression
AES_DECRYPT(), AES_ENCRYPT(), COMPRESS(), RANDOM_BYTES(), STATEMENT_DIGEST(), STATEMENT_DIGEST_TEXT(), UNCOMPRESS(), UNCOMPRESSED_LENGTH(), VALIDATE_PASSWORD_STRENGTH()
JSON functions
JSON_ARRAY_INSERT(), JSON_CONTAINS_PATH(), JSON_INSERT(), JSON_MERGE(), JSON_MERGE_PATCH(), JSON_MERGE_PRESERVE(), JSON_REPLACE(), JSON_SCHEMA_VALID(), JSON_SCHEMA_VALIDATION_REPORT(), JSON_SEARCH(), JSON_SET(), JSON_STORAGE_FREE(), JSON_STORAGE_SIZE(), JSON_VALUE(), MEMBER OF()
Spatial functions
ST_AsGeoJSON(), ST_Buffer(), ST_Buffer_Strategy(), ST_Centroid(), ST_Collect(), ST_ConvexHull(), ST_EndPoint(), ST_ExteriorRing(), ST_FrechetDistance(), ST_GeoHash(), ST_GeometryN(), ST_GeometryType(), ST_GeomFromGeoJSON(), ST_HausdorffDistance(), ST_InteriorRingN(), ST_Intersection(), ST_IsClosed(), ST_IsEmpty(), ST_IsSimple(), ST_IsValid(), ST_LatFromGeoHash(), ST_LineInterpolatePoint(), ST_LineInterpolatePoints(), ST_LongFromGeoHash(), ST_NumGeometries(), ST_NumInteriorRing(), ST_NumInteriorRings(), ST_NumPoints(), ST_PointAtDistance(), ST_PointFromGeoHash(), ST_PointN(), ST_StartPoint(), ST_SwapXY()