小编Mic*_*son的帖子

如何在 Postgres 9.6 中的 uuid 上添加 PostgreSQL GIN 索引

我正在尝试在 Postgres 9.6 数据库中添加一个包含 UUID 的 GIN 索引。从技术上讲,它是一个复合索引,复合 GIN 支持来自 btree_gin 插件。

我尝试用以下语句创建索引:

CREATE EXTENSION btree_gin;
CREATE INDEX ix_tsv ON text_information USING GIN (client_id, text_search_vector);
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

ERROR: data type uuid has no default operator class for access method "gin"
HINT:  You must specify an operator class for the index or define a default operator class for the data type.
Run Code Online (Sandbox Code Playgroud)

client_id是数据类型uuid并且text_search_vectortsvector. 我认为复合/btree_gin 因素实际上并不相关,因为我尝试单独创建索引时遇到相同的错误client_id,但希望如果有解决方案,它也可以与复合索引一起使用。

在 uuid 数组上找到了 PostgreSQL GIN 索引,这似乎表明它应该是可能的(如果可以完成 UUID …

postgresql indexing uuid postgresql-9.6

3
推荐指数
1
解决办法
5365
查看次数

标签 统计

indexing ×1

postgresql ×1

postgresql-9.6 ×1

uuid ×1