Re: JSON Path and GIN Questions

David E. Wheeler <david@justatheory.com>

From: "David E. Wheeler" <david@justatheory.com>
To: Erik Wienhold <ewie@ewie.name>
Cc: Erik Rijkers <er@xs4all.nl>, pgsql-hackers@lists.postgresql.org
Date: 2023-09-16T21:29:18Z
Lists: pgsql-hackers
On Sep 16, 2023, at 16:50, Erik Wienhold <ewie@ewie.name> wrote:

> "For these operators, a GIN index extracts clauses of the form
> **accessors_chain = constant** out of the jsonpath pattern, and does the
> index search based on the keys and values mentioned in these clauses."
> 
> I don't know if this is a general limitation of GIN indexes or just how these
> operators are implemented right now.
> 
> [1] https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING


The detail that jumps out at me is this one on jsonb_path_ops:

“Basically, each jsonb_path_ops index item is a hash of the value and the key(s) leading to it”

Because jsonb_path_ops indexes hashes, I would assume it would only support path equality. But it’s not clear to me from these docs that jsonb_ops also indexes hashes. Does it?

Best,

D

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Doc: add a bit to indices.sgml about what is an indexable clause.