Query Cache Reuses Compiled Skeletal Plans

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database search efficiency is hindered by the time-consuming process of parsing and executing queries, particularly due to the sequential execution of algebraic expressions and inefficient resource usage in conventional database management systems.

Innovation Solution

A query processing system that preprocesses user queries to identify skeletal forms, compiles them into executable versions, and stores these compiled queries for reuse when similar queries are submitted, reducing the need for repeated parsing and execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If each query is parsed and executed sequentially using conventional algebraic expressions, then query accuracy is maintained, but execution time increases significantly

Engineering Contradiction:
Improvequery accuracyVSAvoidexecution time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-compiling queries into executable form before they are actually executed. The query compilation process creates optimized execution plans in advance, which are then stored and reused. This preliminary compilation step eliminates the need for repeated parsing and interpretation during query execution, significantly reducing execution time while maintaining accuracy through the use of pre-validated query structures.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates copies of compiled query execution plans and stores them in a cache for reuse. When the same or similar queries are submitted, the system retrieves and executes the cached compiled version instead of re-parsing and re-compiling. This copying mechanism allows the system to maintain query accuracy through the use of validated execution plans while dramatically reducing execution time by avoiding redundant compilation steps.

Inventive Principle:
Principle #26Copying

2Ease of operation

If conventional query parsing and sequential execution is used, then query processing is straightforward, but resource usage becomes inefficient

Engineering Contradiction:
Improvequery processing simplicityVSAvoidresource usage
Core Design Contradiction:
Ease of operationVSLoss of energy

Solution Approach 1:

The system performs query compilation in advance, creating optimized execution plans before queries are executed. This preliminary action transforms the straightforward but resource-intensive parsing and sequential execution process into a more efficient operation. The compiled queries are stored and reused, reducing the computational resources required for each subsequent execution while maintaining the simplicity of query submission for users.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements a cache mechanism that recovers and reuses compiled query execution plans instead of discarding them after single-use. When queries are submitted, the system checks the cache for existing compiled versions and reuses them when applicable. This recovery and reuse mechanism significantly improves resource efficiency by avoiding redundant compilation and parsing operations, while the system maintains ease of operation by presenting a simple query interface to users.

Inventive Principle:
Principle #34Discarding and recovering

3Productivity

If compiled queries are stored for reuse, then execution efficiency improves, but system complexity increases

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system introduces an intermediary component - a query cache - that sits between the query submission interface and the execution engine. This intermediary handles the complexity of query compilation, caching, and retrieval automatically, allowing the rest of the system to maintain relative simplicity. The cache intermediary manages the stored compiled queries and handles the logic for determining when and how to reuse them, thereby improving execution efficiency without requiring the entire system to become complex.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The query cache system operates autonomously, automatically compiling queries, storing them, and retrieving them for reuse without requiring manual intervention or complex external management. The system self-manages the compilation process, determines which queries are candidates for caching, and handles the retrieval and execution of cached queries. This self-service approach improves execution efficiency while containing system complexity within the autonomous cache module rather than propagating it throughout the entire system.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS9317552B2Reusing existing query plans in a database system
Publication Date: 2016.04.19 SINGLESTORE INC
  • US9317552B2 patent drawing
  • US9317552B2 patent drawing
  • US9317552B2 patent drawing

AI summary

A system and method for executing query plans preprocesses a user's queries to identify and extract select parameters of the query, creates a skeletal query with reference to the extracted parameters, creates and compiles an executable version of the skeletal query, then executes the compiled version of the skeletal query using the particular parameters in the current query. The compiled version of the parameterized skeletal query is stored, and when another query is submitted that matches the skeletal query (but with potentially different parameters), the previously compiled skeleton query is executed with the parameters of this latter query.