# US 2025/0147741 A1 · Evaluating path expressions on binary-encoded documents

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0147741 A1
- Document ID: US20250147741A1
- Status: Published application
- Kind: A1
- Application number: 18/630,432
- Filed: 2024-04-09
- Published: 2025-05-08
- Earliest claimed: 2023-11-08
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Aaron Tacke; Altin Alickaj; Giacomo Fabris; Alexander Ulrich
- Web page: https://patentgrep.com/patent/US20250147741A1

## CPC

- G06F 8/427: {Parsing}
- G06F 16/9027: {Trees}
- G06F 16/24534: {Query rewriting; Transformation}
- G06F 16/25: Integrating or interfacing systems involving database management systems
- G06F 16/90335: {Query processing}
- G06F 40/14: Tree-structured documents (parsing G06F40/205; validation G06F40/226)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to improving the performance of evaluating path expressions on hierarchical data objects represented by binary encoded documents. An abstract syntax tree (AST) representing a path expression may be generated, wherein the AST comprises one or more syntax nodes implementing one or more respective execution steps of an evaluation of the path expression, and the path expression is included in a query to a database management system (DBMS). The AST may be modified based at least in part on profiling information and compiled into machine code. Using the machine code, the path expression may be executed on a binary-encoded hierarchical document.

## Claims

### Claim 1

A method comprising:
generating an abstract syntax tree (AST) representing a path expression, wherein the AST comprises one or more syntax nodes implementing one or more respective execution steps of an evaluation of the path expression, and the path expression is included in a query to a database management system (DBMS);
modifying the AST based at least in part on profiling information;
compiling the AST into machine code;
executing, using the machine code, the path expression on a binary encoded hierarchical document;
wherein the method is performed by one or more computing devices.

### Claim 2 (depends on 2)

The method of claim 2, wherein the binary encoded hierarchical document comprises an inline dictionary that maps field names of the hierarchical data object to field name identifiers of the hierarchical data object.

### Claim 3 (depends on 1)

The method of claim 1, wherein the binary encoded hierarchical document represents a hierarchical data object comprising a plurality of field names, wherein the binary encoded hierarchical document comprises:
a hash-code mapping that maps a hash code corresponding to a field name of the plurality of field names to a field-name identifier,
a field-name mapping that maps the field name to the field name identifier,
a child node mapping that maps a node to one or more child nodes, wherein the node and the one or more child nodes represent field names of the hierarchical data object, and
a field-name-identifier-to-child mapping that maps the field name identifier to the one or more child nodes.

### Claim 4 (depends on 1)

The method of claim 1, wherein the binary encoded hierarchical document represents a JSON document.

### Claim 5 (depends on 1)

The method of claim 1, wherein compiling the AST into machine code further comprises partially evaluating one or more constant expressions of the AST.

### Claim 6 (depends on 1)

The method of claim 1, wherein the AST is compiled into machine code using a just-in-time (JIT) compiler.

### Claim 7 (depends on 1)

The method of claim 1, wherein the binary encoded hierarchical document is a first binary encoded hierarchical document, the method further comprising:
performing a partial interpretation of the AST on a second binary encoded hierarchical document; and
collecting the profiling information from the plain interpretation of the AST.

### Claim 8 (depends on 7)

The method of claim 7, wherein the profiling information comprises at least one of:
a predetermined size of a variable in the second binary encoded hierarchical document,
a cached field identifier from the second binary encoded hierarchical document,
a cached header value of a header of the second binary encoded hierarchical document,
an indication that an array in the second binary encoded hierarchical document having a size of one,
a maximum size of a scalar value in the second binary encoded hierarchical document, or
a cached object in the second binary encoded hierarchical document that stores a field identifier that is referenced by another object in the second binary encoded hierarchical document.

### Claim 9 (depends on 8)

The method of claim 8, wherein modifying the AST based at least in part on the profiling information further comprises at least one of:
modifying a first syntax node of the AST, which implements accessing one or more variables of one or more binary encoded hierarchical documents based at least in part on a dynamically-checked size of the one or more variables, to implement accessing the one or more variables based at least in part on the predetermined size of the variable;
modifying a second syntax node of the AST, which implements performing a binary searches to access one or more field identifiers from the one or more binary encoded hierarchical documents, to implement accessing the one or more field identifiers based at least in part on the cached field identifier;
modifying a third syntax node of the AST, which implements identifying a value from a header of the one or more binary encoded hierarchical documents, to implement inlining the cached header value;
modifying a fourth syntax node of the AST, which implements evaluating index ranges of one or more arrays from the one or more binary encoded hierarchical document, to implement determining whether indexes of the one or more arrays contain “0” or “last” based on the array having a size of one in the profiling information;
modifying a fifth syntax node of the AST to replace a variable-precision scalar data type in the one or more binary encoded hierarchical documents with a primitive data type based at least in part on the maximum size of the scalar value from the profiling information falling below a predetermined threshold; or
modifying a sixth syntax node of the AST to replace one or more objects that implement field identifier sharing with the cached object that stores a field identifier.

### Claim 10 (depends on 1)

The method of claim 1, wherein executing, using the machine code, the path expression on the binary encoded hierarchical document further comprises:
determining whether a value that satisfies the path expression exists in the binary encoded hierarchical document,
identifying the value that satisfies the path expression in the binary encoded hierarchical document, or
identifying all values that satisfy the path expression in the binary encoded hierarchical document.

### Claim 11

One or more non-transitory storage media storing instructions which, when executed by one or more computing devices, cause:
generating an abstract syntax tree (AST) representing a path expression, wherein the AST comprises one or more syntax nodes implementing one or more respective execution steps of an evaluation of the path expression, and the path expression is included in a query to a database management system (DBMS);
modifying the AST based at least in part on profiling information;
compiling the AST into machine code;
executing, using the machine code, the path expression on a binary encoded hierarchical document.

### Claim 12 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein the binary encoded hierarchical document comprises an inline dictionary that maps field names of the hierarchical data object to field name identifiers of the hierarchical data object.

### Claim 13 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein the binary encoded hierarchical document represents a hierarchical data object comprising a plurality of field names, wherein the binary encoded hierarchical document comprises:
a hash-code mapping that maps a hash code corresponding to a field name of the plurality of field names to a field-name identifier,
a field-name mapping that maps the field name to the field name identifier,
a child node mapping that maps a node to one or more child nodes, wherein the node and the one or more child nodes represent field names of the hierarchical data object, and
a field-name-identifier-to-child mapping that maps the field name identifier to the one or more child nodes.

### Claim 14 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein the binary encoded hierarchical document represents a JSON document.

### Claim 15 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein compiling the AST into machine code further comprises partially evaluating one or more constant expressions of the AST.

### Claim 16 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein the AST is compiled into machine code using a just-in-time (JIT) compiler.

### Claim 17 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein the binary encoded hierarchical document is a first binary encoded hierarchical document, the method further comprising:
performing a partial interpretation of the AST on a second binary encoded hierarchical document; and
collecting the profiling information from the plain interpretation of the AST.

### Claim 18 (depends on 17)

The one or more non-transitory storage media of claim 17, wherein the profiling information comprises at least one of:
a predetermined size of a variable in the second binary encoded hierarchical document,
a cached field identifier from the second binary encoded hierarchical document,
a cached header value of a header of the second binary encoded hierarchical document,
an indication that an array in the second binary encoded hierarchical document having a size of one,
a maximum size of a scalar value in the second binary encoded hierarchical document, or
a cached object in the second binary encoded hierarchical document that stores a field identifier that is referenced by another object in the second binary encoded hierarchical document.

### Claim 19 (depends on 18)

The one or more non-transitory storage media of claim 18, wherein modifying the AST based at least in part on the profiling information further comprises at least one of:
modifying a first syntax node of the AST, which implements accessing one or more variables of one or more binary encoded hierarchical documents based at least in part on a dynamically-checked size of the one or more variables, to implement accessing the one or more variables based at least in part on the predetermined size of the variable;
modifying a second syntax node of the AST, which implements performing a binary searches to access one or more field identifiers from the one or more binary encoded hierarchical documents, to implement accessing the one or more field identifiers based at least in part on the cached field identifier;
modifying a third syntax node of the AST, which implements identifying a value from a header of the one or more binary encoded hierarchical documents, to implement inlining the cached header value;
modifying a fourth syntax node of the AST, which implements evaluating index ranges of one or more arrays from the one or more binary encoded hierarchical document, to implement determining whether indexes of the one or more arrays contain “0” or “last” based on the array having a size of one in the profiling information;
modifying a fifth syntax node of the AST to replace a variable-precision scalar data type in the one or more binary encoded hierarchical documents with a primitive data type based at least in part on the maximum size of the scalar value from the profiling information falling below a predetermined threshold; or
modifying a sixth syntax node of the AST to replace one or more objects that implement field identifier sharing with the cached object that stores a field identifier.

### Claim 20 (depends on 11)

The one or more non-transitory storage media of claim 11, wherein executing, using the machine code, the path expression on the binary encoded hierarchical document further comprises:
determining whether a value that satisfies the path expression exists in the binary encoded hierarchical document,
identifying the value that satisfies the path expression in the binary encoded hierarchical document, or
identifying all values that satisfy the path expression in the binary encoded hierarchical document.
