Re: JSON Path and GIN Questions

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: JSON Path and GIN Questions
Date: 2023-09-16 20:50:13
Message-ID: 164182692.82468.1694897413058@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16/09/2023 22:19 CEST David E. Wheeler <david(at)justatheory(dot)com> wrote:

> On Sep 15, 2023, at 23:59, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>
> > movie @? '$ ?($.year >= 2023)'
> >
> > I believe it is indeed not possible to have such a unequality-search use
> > the GIN index. It is another weakness of JSON that can be unexpected to
> > those not in the fullness of Knowledge of the manual. Yes, this too would
> > be good to explain in the doc where JSON indexes are explained.
>
> Is that a limitation of GIN indexes in general? Or could there be opclass
> improvements in the future that would enable such comparisons?

This detail is mentioned in docs [1]:

"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

--
Erik

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2023-09-16 21:29:18 Re: JSON Path and GIN Questions
Previous Message Nathan Bossart 2023-09-16 20:40:41 Re: Add 'worker_type' to pg_stat_subscription