Commit 552cfcb
Merge cockroachdb#150793
150793: sql/jsonpath: index accelerate jsonb_path_exists filters r=ZhouXing19 a=ZhouXing19
Fixes: cockroachdb#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.
Co-authored-by: ZhouXing19 <[email protected]>File tree
23 files changed
+1574
-25
lines changed- pkg
- ccl/logictestccl/tests
- 3node-tenant
- local-read-committed
- local-repeatable-read
- sql
- logictest
- testdata/logic_test
- tests
- fakedist-disk
- fakedist-vec-off
- fakedist
- local-legacy-schema-changer
- local-mixed-25.2
- local-mixed-25.3
- local-vec-off
- local
- opt
- exec/execbuilder
- testdata
- tests/local
- invertedidx
- xform/testdata/rules
- util
- jsonpath
- json
23 files changed
+1574
-25
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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