Unlock instant, AI-driven research and patent intelligence for your innovation.

PostgreSQL preparatory statement execution optimization method

An optimization method and statement technology, applied in the database field, can solve the problem of low execution efficiency

Active Publication Date: 2020-10-20
WUHAN UNIV
View PDF20 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Although the use of prepared statements can save the time spent on building the plan tree, it still needs to rebuild the corresponding PlanState tree every time a query is executed, and the construction overhead may take up to 30% of the total execution time of a query
[0006] It can be seen that the method in the prior art has the technical problem of low execution efficiency

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • PostgreSQL preparatory statement execution optimization method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045] The invention discloses a method for optimizing the execution of PostgreSQL prepared statements. In the method, an optimization scheme for caching and reusing PlanState in the execution process of the prepared statements is proposed. In this optimization scheme, when a prepared statement is compiled and executed, after the execution plan is cached, the PlanState structure constructed when the cached execution plan is executed for the first time is saved, and the saved PlanState is reused in subsequent executions, only for Some member values ​​in the structure are reassigned to avoid the time consumption caused by rebuilding PlanState every time it is executed. This method significantly improves the execution efficiency of the prepared statement by optimizing the execution of the PostgreSQL prepared statement.

[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embod...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a PostgreSQL preparatory statement execution optimization method. In the method, an optimization scheme of caching PlanState in a preparatory statement execution process and repeatedly using the PlanState is provided. In this optimization scheme, when one preparatory statement is compiled and executed, after an execution plan is cached, the PlanState structure constructed when the cached execution plan is executed for the first time is saved, the saved PlanState is reused in subsequent execution, and only part of member values in the structure are re-assigned, so that the time consumption caused by re-constructing the PlanState during each time of execution is avoided. According to the method, the execution of the PostgreSQL preparatory statement is optimized, so that the execution efficiency of the preparatory statement is remarkably improved.

Description

technical field [0001] The invention relates to the technical field of databases, in particular to a PostgreSQL prepared statement execution optimization method. Background technique [0002] The execution of SQL is roughly divided into several steps of analysis, optimization and execution. The result of parsing and optimization is an execution plan. Usually, the same SQL statement is executed many times, and each execution is likely to use the same execution plan. The process of generating an execution plan takes time, especially for some complex SQL. By using the prepared statement, the execution plan is cached, and the optimization step is skipped at the next execution. The user can repeatedly bind different parameters to the prepared statement. If the SQL statement of this structure is executed many times, the database The system avoids parsing and optimizing a large number of SQL statements with the same structure, thereby improving system performance. [0003] Prepa...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F16/242G06F16/2453
CPCG06F16/2453G06F16/2433G06F16/24539
Inventor 彭煜玮沈忱兰海
Owner WUHAN UNIV