Skip to content

sql: support remainder of the postgres trigram module (pg_trgm) #41285

@rohany

Description

@rohany

The postgres trigram module (https://www.postgresql.org/docs/9.6/pgtrgm.html) is used for various kind of text search applications. A good chunk of it is supported in CockroachDB 22.2 (see below list of functionality), but not everything yet.

Supported in CockroachDB 22.2:

  • similarity(), show_trgm()
  • text % text
  • pg_trgm.similarity_threshold
  • trigram gin inverted indexes
  • Accelerate %
  • Accelerate LIKE and ILIKE

Not yet supported:

  • Implement word_similarity()
  • Implement strict_word_similarity()
  • Implement %> and <% (word similarity search)
  • Accelerate %> and <%
  • Implement <<% and %>> (strict word similarity search)
  • Acclerate %>> and <<%
  • Implement <->, <<->, <->>, <<<->, and <->>> (distance, word similarity, and strict word similarity operators. Note that they do not get accelerated in PG at all.)
  • Accelerate regex match
  • trigram operators and functions, like % and show_trgm, on collated string types

Jira issue: CRDB-5466
Epic: CRDB-15016

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-pgcompatSemantic compatibility with PostgreSQLA-tools-efcoreC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions