gpt4 book ai didi

postgresql - Postgres : Composite fulltext/btree index

转载 作者:行者123 更新时间:2023-11-29 11:49:12 25 4
gpt4 key购买 nike

我想对一列进行全文搜索,然后在另一列中进行排序。如果我分别为这两列编制索引,postgres 将无法在此查询中同时使用这两个索引。有没有办法创建可以在这种情况下使用的复合索引?

最佳答案

不幸的是没有。

虽然您可以通过 btree_gin 将标量列附加到 GIN 索引contrib 模块,Postgres 不能使用 GIN 索引进行排序。来自docs :

Of the index types currently supported by PostgreSQL, only B-tree can produce sorted output — the other index types return matching rows in an unspecified, implementation-dependent order.

关于postgresql - Postgres : Composite fulltext/btree index,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48327224/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com