Database Query Parsing Using the Built-In Parser and Empty Tables

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing third-party parsers for database query statements have low parsing coverage, accuracy, and efficiency, and lack semantic optimization capabilities, particularly when dealing with diverse database syntaxes and versions.

Innovation Solution

Utilize a parser installed in the database to parse query statements by creating an empty database table with the same structure, executing the query in this table, and generating a syntax tree serialization result, leveraging the database's parsing capabilities for improved accuracy and coverage.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a third-party parser is used to parse database query statements, then parsing can be performed externally, but parsing coverage, accuracy, and efficiency are low

Engineering Contradiction:
Improveparsing accuracyVSAvoidparsing coverage
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The database system uses its own built-in parser to parse query statements instead of relying on external third-party parsers. This self-service approach ensures that the parsing is performed by the same system that will execute the query, guaranteeing consistency and accuracy while maintaining full support for all database syntaxes and versions.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The database's built-in parser is designed to handle all query statement syntaxes supported by the database system, making it universally applicable. This multi-functional parser can accurately parse any query statement regardless of syntax variations or version differences, providing both high accuracy and comprehensive coverage.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Productivity

If a third-party parser is used, then parsing can be separated from execution, but semantic optimization is not achieved

Engineering Contradiction:
Improveparsing efficiencyVSAvoidsemantic optimization
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The parsing function is merged with the query execution process within the same database system. The built-in parser integrates parsing, semantic optimization, and execution functions, ensuring that semantic optimization is performed as part of the normal query processing flow. This integration maintains high parsing efficiency while achieving reliable semantic optimization.

Inventive Principle:
Principle #5Merging (Combining)

3Ease of operation

If third-party parser is used, then external parsing capability is provided, but version limitations and syntax compatibility issues occur

Engineering Contradiction:
Improveexternal parsing capabilityVSAvoidsyntax compatibility
Core Design Contradiction:
Ease of operationVSAdaptability or versatility

Solution Approach 1:

The database system provides its own self-service parsing capability through the built-in parser. This eliminates the need for external parsing tools and ensures that all syntaxes supported by the database system can be parsed correctly. The self-service parser automatically adapts to different versions and syntax variations without requiring external intervention.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS20260010714A1Method and device for parsing database query statement, and storage medium
Publication Date: 2026.01.08 BEIJING VOLCANO ENGINE TECH CO LTD
  • US20260010714A1 patent drawing
  • US20260010714A1 patent drawing
  • US20260010714A1 patent drawing

AI summary

Provided are a method and device for parsing a database query statement, and a storage medium. A query statement for a database table to be queried is obtained, and an empty database table corresponding to the database table to be queried is created; the query statement is executed in the empty database table, and a parser installed in a database is called to parse the query statement to obtain a syntax tree, and an execution plan is generated based on the syntax tree for execution in the empty database table; and the syntax tree is obtained from the parser in an execution process of the query statement, and a syntax tree serialization result is generated and output as a parsing result of the query statement.