我正在寻找在长列上创建索引的替代方法:
create table line
(
field_key integer not null,
value varchar(4000),
...
);
create index key_value_idx on line (field_key, value);
Run Code Online (Sandbox Code Playgroud)
结果DB2 SQL Error: SQLCODE=-614, SQLSTATE=54008。文档说:The sum of the stored lengths of the specified columns must not be greater than 1024。对于 MySQL 中的这种情况,有语法:
create index key_value_idx on line (field_key, value(1000));
Run Code Online (Sandbox Code Playgroud)
和 HSQLDB 只是没有任何限制地工作。
DB2 的类似物是什么?
db2 ×1