Re: JSON Path and GIN Questions
Erik Rijkers <er@xs4all.nl>
From: Erik Rijkers <er@xs4all.nl>
To: "David E. Wheeler" <david@justatheory.com>
Cc: Erik Wienhold <ewie@ewie.name>, pgsql-hackers@lists.postgresql.org
Date: 2023-09-14T04:04:28Z
Lists: pgsql-hackers
p 9/13/23 om 22:01 schreef David E. Wheeler: > On Sep 13, 2023, at 01:11, Erik Rijkers <er@xs4all.nl> wrote: > >> "All use of json*() functions preclude index usage." >> >> That sentence is missing from the documentation. > > Where did that come from? Why wouldn’t JSON* functions use indexes? I see that the docs only mention operators; why would the corresponding functions behave the same? > > D Sorry, perhaps my reply was a bit off-topic. But you mentioned perhaps touching the docs and the not-use-of-index is just so unexpected. Compare these two statements: select count(id) from movies where movie @? '$ ? (@.year == 2023)' Time: 1.259 ms (index used) select count(id) from movies where jsonb_path_match(movie, '$.year == 2023'); Time: 17.260 ms (no index used - unexpectedly slower) With these two indexes available: using gin (movie); using gin (movie jsonb_path_ops); (REL_15_STABLE; but it's the same in HEAD and the not-yet-committed SQL/JSON patches.) Erik Rijkers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Doc: add a bit to indices.sgml about what is an indexable clause.
- b7412e293b6b 17.0 landed
- b4c147ac6fd5 13.14 landed
- afc987e19610 15.6 landed
- 8b9d39254816 16.2 landed
- 7a4bdd986ab9 14.11 landed
- 499342e81b0f 12.18 landed