Skip to content

Commit 7ddbf29

Browse files
committed
sql/jsonpath: index accelerate jsonb_path_exists filters
Fixes: #154044 This commit is to generate inverted expression for filter (i.e. WHERE clauses) with the `jsonb_path_exists` function. Release note (sql change): We now support index acceleration for a subset of jsonb_path_exists filters. Given the `jsonb_path_exists(json_obj, json_path_expression)`, we only support inverted index for json_path_expression that matches one of the following patterns: - The json_path_expression must NOT be in STRICT mode. - keychain mode: $.[key|wildcard].[key|wildcard]... - For this mode, we will generate a prefix span for the inverted expression. - filter with end value mode, with equality check: $.[key|wildcard]? (@.[key|wildcard].[key|wildcard]... == [string|number|null|boolean]) - For this mode, since the end value is fixed, we will generate a single value span. Specifically, we don't support the following edge case: - $ - $[*] - $.a.b.c == 12 or $.a.b.c > 12 or $.a.b.c < 12 (operation expression) - $.a.b ? (@.a > 10) (filter, with inequality check) Note that the cases we support is to use `jsonb_path_exists` in filters, as in, when they are used in the WHERE clause.
1 parent 99ad9a0 commit 7ddbf29

File tree

23 files changed

+1574
-25
lines changed

23 files changed

+1574
-25
lines changed

pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/ccl/logictestccl/tests/local-read-committed/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/ccl/logictestccl/tests/local-repeatable-read/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)