Query Optimizer Table Elimination for Duplicate-Insignificant Joins
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database queries often contain inefficient join operations due to unnecessary tables, leading to increased execution time and resource usage, particularly when generated by middleware software or human developers without optimization checks.
Innovation Solution
The method involves evaluating queries for outer-joined and cross-joined table elimination in duplicate-insignificant query blocks, removing non-preserved tables and corresponding join operations, thereby transforming the queries to reduce unnecessary processing and conserve resources.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If join operations are added to combine table contents, then data completeness is improved, but query execution time increases
Solution Approach 1:
The patent extracts and removes unnecessary tables from join operations through query rewriting. The query optimizer identifies tables that can be eliminated without affecting result correctness, thereby reducing execution time while preserving data completeness for necessary joins.
Solution Approach 2:
The patent changes the execution parameters by transforming the query execution plan to evaluate join necessity dynamically. It modifies how joins are executed by eliminating redundant ones, changing the operational parameters from executing all specified joins to executing only necessary joins.
2Reliability
If join operations are added to combine table contents, then data completeness is improved, but resource usage increases
Solution Approach 1:
The patent extracts unnecessary tables from the query execution plan through automated rewriting. By removing redundant table accesses and join operations, it reduces CPU, memory, and I/O resource consumption while preserving the completeness of necessary data retrieval.
Solution Approach 2:
The query optimizer performs self-service by automatically analyzing and rewriting queries to eliminate unnecessary joins. This self-optimization process reduces resource usage without requiring manual intervention, making the system efficient while maintaining data completeness.
3Ease of operation
If middleware software generates queries automatically, then ease of use is improved, but query optimization is worsened
Solution Approach 1:
The patent introduces a query rewriting intermediary layer between the middleware-generated query and the database execution engine. This intermediary automatically rewrites queries to eliminate unnecessary joins, bridging the gap between ease of use (automatic query generation) and execution efficiency (optimized query plans).
Solution Approach 2:
The query optimizer provides self-service by automatically detecting and eliminating unnecessary joins in middleware-generated queries. This self-optimization compensates for the lack of manual optimization while preserving the ease of use benefits of automatic query generation.
Data Source
AI summary
A method and apparatus for outer-joined and/or cross-joined table elimination for duplicate-insignificant queries is provided. A query block of a query specifies a join between a first table and a second table. The join is one of an outer join and a cross join. A first determination is made that the query block contains no references to the second table to be processed after the join. A second determination is made that the query block is duplicate-insignificant. In response to making the first determination and the second determination, the query block is transformed into a transformed query, where the second table is eliminated from a corresponding query block in the transformed query.


