小编dma*_*a_k的帖子

为长列创建索引

我正在寻找在长列上创建索引的替代方法:

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

3
推荐指数
2
解决办法
5813
查看次数

标签 统计

db2 ×1