Database Access Execution Plan Selection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current database access methods are inefficient due to time-consuming execution plan formulation processes, often requiring cumbersome statistics calculations and sampling, leading to prolonged user access times. Existing solutions either reuse execution plans for similar access requests or generate multiple plans based on varying parameters, impacting database access efficiency and accuracy.
Innovation Solution
A method and apparatus that receive a database access statement, parse it to determine user parameters, group objects by similarity, and select a pre-stored execution plan from a plan cache based on the statement type, reducing the number of execution plans and improving access efficiency and accuracy by aggregating objects with similar patterns.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If execution plans are formulated individually for each access request, then access accuracy is improved, but access time increases excessively
Solution Approach 1:
The patent pre-calculates and stores execution plans for different parameter ranges before actual access requests are made. When an access request arrives, the system directly retrieves the pre-prepared execution plan matching the request's parameters, avoiding time-consuming real-time calculations while maintaining accurate plan selection
Solution Approach 2:
The system performs preliminary grouping of database objects based on their parameters and pre-generates execution plans for each group. This advance preparation allows the system to quickly match incoming requests with appropriate pre-computed plans, resolving the contradiction between accuracy and speed
2Loss of time
If execution plans are reused for similar access requests, then access time is reduced, but access accuracy deteriorates
Solution Approach 1:
The patent segments the parameter space into distinct ranges and creates separate execution plans for each segment. When an access request arrives, the system identifies which segment the request's parameters fall into and retrieves the corresponding specialized execution plan, ensuring both speed through reuse and accuracy through parameter-specific optimization
Solution Approach 2:
Different execution plans are created for different parameter ranges, with each plan optimized for its specific local conditions. This allows the system to reuse plans efficiently within each parameter segment while maintaining accuracy by selecting the plan that best matches the actual request parameters
3Measurement precision
If multiple execution plans are formulated based on different parameters, then access accuracy is improved, but system complexity increases
Solution Approach 1:
The patent merges database objects with similar parameters into groups and creates a single execution plan for each group. This consolidation reduces the total number of execution plans needed while maintaining accuracy by ensuring that objects with similar characteristics share the same optimized plan, thereby simplifying the system
Solution Approach 2:
Execution plans are designed to be universal for groups of objects sharing common parameter characteristics. A single execution plan serves multiple objects within its parameter range, reducing system complexity by eliminating redundant plans while preserving accuracy through parameter-based grouping
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
Implementations of the present specification provide database access methods and apparatuses. The database access method includes the following: receiving a database access statement; parsing the database access statement to determine a target user parameter included in the database access statement; determining a statement type of the database access statement; obtaining a pre-stored execution plan group corresponding to the database access statement of the statement type; selecting a target execution plan from the obtained execution plan group based on the target user parameter; and executing the target execution plan.