Specialized Interpreter for Database Statement Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing database management systems face performance penalties due to the need for real-time parsing and interpretation of SQL statements, which incurs overhead and reduces system throughput, as they lack efficient mechanisms for generating machine code for database statements.

Innovation Solution

The solution involves specializing interpreter code within the database server to create machine code for database statements, using techniques like Partial Evaluation and Program/Algorithm Specialization, allowing for the generation of optimized machine code that reduces interpretive overhead and improves execution speed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If SQL statements are interpreted by the database server at runtime, then the system can process any new SQL statement dynamically, but the execution speed is reduced due to interpretive overhead

Engineering Contradiction:
Improveability to process any new SQL statement dynamicallyVSAvoidexecution speed of SQL statements
Core Design Contradiction:
Adaptability or versatilityVSSpeed

Solution Approach 1:

The patent applies preliminary action by generating and caching execution plans for SQL statements before they are executed. The system parses SQL statements, generates execution plans, and stores them in a cache, so that when the same SQL statement is encountered again, the pre-generated execution plan can be reused immediately without re-parsing, thus improving execution speed while maintaining the ability to handle new statements dynamically

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses copying by creating copies of execution plans for frequently executed SQL statements and storing them in a cache. Instead of interpreting the same SQL statement multiple times, the system creates and stores execution plan copies that can be rapidly retrieved and executed, reducing interpretive overhead while maintaining adaptability to new statements

Inventive Principle:
Principle #26Copying

2Speed

If a compiler generates machine code ahead of time, then execution speed is improved, but the system cannot process SQL statements that are not known until runtime

Engineering Contradiction:
Improveexecution speed of machine codeVSAvoidability to process unknown SQL statements
Core Design Contradiction:
SpeedVSAdaptability or versatility

Solution Approach 1:

The patent applies dynamics by creating a hybrid system that combines interpretation and compilation. The system starts with interpretation to handle any SQL statement dynamically, then dynamically compiles frequently executed statements into machine code execution plans and caches them. This dynamic adaptation allows the system to maintain versatility for new statements while achieving compiler-level speed for recurring statements

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent uses an intermediary approach by introducing an execution plan as an intermediate representation between the SQL statement and the actual execution. The execution plan serves as a mediator that can be generated through interpretation, optimized, cached, and executed as pre-compiled machine code, thus bridging the gap between interpretive flexibility and compiled speed

Inventive Principle:
Principle #24Intermediary (Mediator)

3Adaptability or versatility

If SQL statements are parsed and execution plans are created at database runtime, then flexibility in processing is maintained, but system throughput is reduced

Engineering Contradiction:
Improveflexibility in processing SQL statementsVSAvoidsystem throughput
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies preliminary action by pre-generating and caching execution plans for SQL statements during idle periods or upon first execution. This allows the database server to process multiple identical or similar SQL statements using pre-prepared execution plans, significantly increasing system throughput while maintaining the flexibility to handle new statements by generating their execution plans on demand

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS8793240B2Generation of machine code for a database statement by specialization of interpreter code
Publication Date: 2014.07.29 ORACLE INT CORP
  • US8793240B2 patent drawing
  • US8793240B2 patent drawing
  • US8793240B2 patent drawing

AI summary

After receipt of an instruction (e.g. a database statement), one or more computers specialize an interpreter with the received instruction as constant, to obtain a specialized interpreter that is stored in memory and/or disk. The specialized interpreter is then invoked to execute the received instruction. Depending on the embodiment, the interpreter being specialized may additionally be received and used in binary form without specialization. Specifically, in some embodiments, an identical interpreter is received in two forms: in a binary language specific to the one or more computers and also in a language that is acceptable to a specializer, such as a source language or an intermediate language. The interpreter in the binary language is invoked by default unless a predetermined condition for specialization is met. When the predetermined condition is met, the interpreter in the specializer-acceptable language is specialized by the specializer, and then the specialized interpreter is invoked.