兼容性判定
公开资料依据 · 建议 PoC 复核支持度partial
严重度major
置信度medium
依据规则my.ddl.prefix_index
怎么改
按字符/字节口径建立 left(column,n) 表达式索引
判定说明
表达式索引可承接前缀访问,但语法、唯一性、collation 和多字节长度口径不同;建议 PoC 复核
库侧 / 应用侧路径
库侧改造
可行:按字符/字节口径建立表达式索引并重算选择性
应用侧改造
不可行:索引定义应在数据库部署侧改造
推荐路线:db_side。验证建议:多字节字符、大小写/collation、唯一冲突、选择性和执行计划
规则样例
CREATE INDEX ix_customer_name ON customer(name(10))
CREATE TABLE doc (body TEXT, KEY ix_body(body(64)))
CREATE INDEX ix_name ON customer(tenant_id, name(10))
参考来源
- https://dev.mysql.com/doc/refman/8.4/en/create-index.html#column-indexes
- https://www.postgresql.org/docs/16/indexes-expressional.html
- https://www.postgresql.org/docs/16/datatype.html
- https://www.postgresql.org/docs/16/functions.html
- https://www.postgresql.org/docs/16/sql-commands.html
- https://github.com/tobymao/sqlglot/blob/64e268a5d95cd84a87ad74ef569fc9bf356fd3fb/README.md#unsupported-errors
相关改造点
- MYSQL → postgresql 16 全部改造点
- postgresql 16 兼容性总览
- MYSQL 迁移国产库总览
- ORACLE ADD_MONTHS 函数 迁移 postgresql 16 怎么改
- ORACLE ALTER SESSION SET 会话参数 迁移 postgresql 16 怎么改
- ORACLE ANYDATA 动态类型列 迁移 postgresql 16 怎么改
- ORACLE ASCIISTR Unicode 转义函数 迁移 postgresql 16 怎么改
- ORACLE 关联数组(INDEX BY 表) 迁移 postgresql 16 怎么改
- ORACLE AT TIME ZONE 时区表达式 迁移 postgresql 16 怎么改