Schema-Free Static Query Template for Graph Database Performance

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Dynamic GSQL queries face issues with runtime user input errors, performance subparities due to runtime interpretation, and high costs associated with customer schema installations, especially when dealing with large numbers of vertex and edge types, leading to slow type and semantic checks.

Innovation Solution

Implementing a schema-free static query template approach that uses a dummy schema for compile-time type, syntax, and semantic checks, storing the query template in storage, and generating static query binaries for efficient execution, with a hash-based caching mechanism to optimize performance and stability.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If dynamic GSQL queries use runtime interpretation of metadata parameters, then flexibility and schema-free operation are achieved, but performance deteriorates due to runtime type checking and interpretation overhead

Engineering Contradiction:
Improveschema-free operationVSAvoidquery execution performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent performs type checking, syntax validation, and semantic analysis during query compilation rather than at runtime. The query template is pre-validated against a dummy schema, and all structural checks are completed before the query is executed, eliminating runtime interpretation overhead while maintaining schema-free operation through parameterized templates.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent separates the query template (with placeholders) from the actual execution parameters. The template structure is validated separately from the runtime data, allowing the query logic to be compiled once while accepting different parameters at runtime without re-validation, thus improving performance while maintaining flexibility.

Inventive Principle:
Principle #1Segmentation

2Reliability

If dynamic GSQL queries perform type checking and semantic validation using customer schema, then query correctness is ensured, but processing time increases significantly when schema contains hundreds of vertex and edge types

Engineering Contradiction:
Improvequery correctnessVSAvoidtype checking duration
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent introduces a dummy schema as an intermediary for validation purposes. Instead of checking against the full customer schema with hundreds of types, the query template is validated against a simplified dummy schema that contains only the necessary structure. This intermediary validation ensures query correctness without the computational overhead of checking against the complete customer schema.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent creates a simplified copy of the schema structure (dummy schema) that contains only the essential elements needed for validation. This copy retains the structural properties necessary for type checking and semantic validation while eliminating the complexity and size of the full customer schema, thus reducing validation time while maintaining reliability.

Inventive Principle:
Principle #26Copying

3Adaptability or versatility

If dynamic GSQL generates runtime errors due to wrong user input metadata, then flexibility is maintained, but system stability deteriorates

Engineering Contradiction:
Improveuser input flexibilityVSAvoidquery execution stability
Core Design Contradiction:
Adaptability or versatilityVSStability of the object's composition

Solution Approach 1:

The patent performs comprehensive validation of user input metadata during the query compilation phase rather than at runtime. The dummy schema validation checks for correctness of vertex types, edge types, and attribute references before the query is executed. This preliminary validation prevents runtime errors while maintaining the flexibility to accept user-provided metadata parameters.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12117996B2Schema-free static query template
Publication Date: 2024.10.15 TIGERGRAPH INC
  • US12117996B2 patent drawing
  • US12117996B2 patent drawing
  • US12117996B2 patent drawing

AI summary

A schema-free static query template improves schema-free graph query performance and runtime stability. A user can customize a generated graph query while detecting a query tampering state. Schema-free query templates, which have been compile-time type/syntax/semantic checked by a dummy schema, are installed. The templates are called as if they are functions with their selected graph schema vertex types and edge types. The invocation generates a static query which uses input metadata to instantiate a static query, and goes through type/syntax/semantic checks to capture any input errors at compile time. If there is no error found during compile time, a query binary is generated only containing the metadata related to the parameters and sent to a query engine for execution. If a user later invokes the same query with the same metadata, the compiler matches the generated previous query, bypasses compilation, and goes directly to the existing binary code.