Skip to content

EQL v4 docs: the JSON GIN index does not serve <@, and the ORE operator class has a new name #1968

In review

Description

@auxesis

Background

EQL (Encrypt Query Language) is the SQL library CipherStash installs into a PostgreSQL database. It stores encrypted values and lets the database query them. Its reference docs are in packages/eql/docs/reference. Version 4 of EQL installs the eql_v4 schema. The Go SDK uses that schema.

Problem

Two sentences in the EQL v4 reference docs are wrong. A user who follows either one gets a result they did not expect, with no error.

  1. json-tree.md, lines 91 to 96, says a GIN index with jsonb_path_ops "serves both operators". The two operators are @> and <@.
    • PostgreSQL's jsonb_path_ops operator class supports @> only.
    • A test in docs(golang): give the index statement for each EQL query #1931 built the index on 20,000 rows in PostgreSQL 17, with the EQL v4 bundle from the Go SDK's rc.7 release. EXPLAIN ANALYZE showed the index in use for @>, and not for <@.
    • So a <@ query scans every row, and the user is not told.
    • The EQL v3 page database-indexes.md, line 237, already says jsonb_path_ops indexes @> only.
  2. eql-functions.md, line 169, says an ORE column needs the eql_v4_internal.ore_block_256 btree operator class.
    • docs/upgrading/v3.1.md, line 51, says the v4 bundle renamed ore_block_256 to ore_block_v2.
    • The v4 bundle installs ore_block_v2_operator_class. This was seen in the same test.
    • So a user who checks pg_opclass for the name in the docs does not find it, even on an install that has the class.

Nothing catches either error, because no test reads the prose of the reference docs.

Proposal

  1. In json-tree.md, say the GIN index serves @> only. Say what a <@ query does without it: it reads every row. Add any index that serves <@, if one exists, after testing it.
  2. In eql-functions.md, name the v4 operator class ore_block_v2_operator_class, in the eql_v4_internal schema. Check the rest of that page, and the other eql_v4 pages, for the old name.
  3. Check each corrected statement against the v4 SQL in packages/eql/src, and say where.

Evidence

Metadata

Metadata

Assignees

Labels

SDKbugdocumentation

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions