Skip to content

EQL v3: make incorrect JSON functional indexes discoverable #980

Description

@tobyhede

For encrypted JSON containment, the indexable column expression is
eql_v3.to_ste_vec_query(column)::jsonb. Calling eql_v3.ste_vec(column) is
also legal and produces an indexable type, so PostgreSQL accepts a GIN index on
it even though containment queries can never use that index.

The repository now documents the correct per-domain index recipes, but the SQL
function that creates the trap still gives no local indication that it is an
element accessor rather than an index-term extractor.

Acceptance criteria

  • COMMENT ON FUNCTION eql_v3.ste_vec(jsonb) identifies it as an element
    accessor, warns that it is not the containment index expression, and points
    to eql_v3.to_ste_vec_query(column)::jsonb.
  • The generated SQL bundle preserves that comment.
  • Index guidance and an EXPLAIN-backed regression test continue to use the exact
    expression that the containment operator inlines to.

Historical provenance: cipherstash/encrypt-query-language#417. That repository
is archived; this Stack issue is the canonical location for remaining work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions