【问题标题】:Searching a large string in Database在数据库中搜索大字符串
【发布时间】:2021-01-22 09:29:07
【问题描述】:

所以我有一个表,其中一个列用于存储通常有 10000 个字符的字符串类型的数据。当试图匹配一个特定的字符串时,它需要大量的操作时间。有什么办法可以减少吗??

【问题讨论】:

  • 您可以使用 Postgres 丰富的全文搜索功能。

标签: sql postgresql cockroachdb


【解决方案1】:

如果您需要像这样优化选择查询

select *
from tbl
where field_code ilike '%text%'

使用杜松子酒索引

更多信息在这里https://hashrocket.com/blog/posts/exploring-postgres-gin-index

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-10-13
    • 2011-03-26
    • 2014-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    相关资源
    最近更新 更多