Query Generation via Join Graph Subgraph Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Complex database schemas, such as those with chasm traps and fan traps, can lead to unexpected query results due to double-counting and logical errors, making it challenging to conduct meaningful analysis and requiring additional subqueries to prevent over-counting.
Innovation Solution
A system for query generation based on a logical data model that accesses a join graph, selects connected subgraphs, identifies one-to-one joins, and transforms queries to avoid over-counting by generating leaf queries and a query graph with a single root node, thereby simplifying the query process and improving performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If complex database schemas with chasm traps and fan traps are used, then data storage capability is improved, but query accuracy deteriorates due to double-counting and logical errors
Solution Approach 1:
The patent segments the complex query into multiple subqueries, each handling a specific portion of the data retrieval. By dividing the query execution into discrete segments that can be independently managed and joined, the system avoids double-counting issues that arise in complex schemas with chasm traps and fan traps.
Solution Approach 2:
The patent introduces an intermediary query generation system that acts as a mediator between the user's high-level query and the complex database schema. This intermediary analyzes the schema structure, identifies potential double-counting risks, and automatically generates corrected subqueries with proper join conditions, thereby preserving query accuracy without requiring schema simplification.
2Measurement precision
If additional subqueries are added to prevent over-counting, then query accuracy is improved, but query complexity increases
Solution Approach 1:
The patent performs preliminary analysis of the database schema and query structure before execution. By pre-identifying chasm traps, fan traps, and potential double-counting scenarios, the system can automatically generate the necessary subqueries and join conditions in advance, rather than requiring manual intervention to add complexity.
Solution Approach 2:
The patent implements a self-service query generation system that automatically analyzes the database schema, identifies accuracy issues, and generates appropriate subqueries without requiring user intervention. This automation hides the underlying complexity from the user while maintaining high query accuracy through programmatically generated corrections.
3Measurement precision
If manual query construction is used to handle complex schemas, then query accuracy is improved, but ease of operation deteriorates
Solution Approach 1:
The patent implements a self-service system where the database interface automatically analyzes complex schemas, identifies potential accuracy issues, and generates corrected queries without requiring manual user intervention. This maintains high query accuracy while preserving ease of operation by hiding the complexity from the user.
Solution Approach 2:
The patent introduces an intermediary layer between the user and the database schema that automatically handles the complexity of query construction. This mediator translates simple user requests into accurate complex queries, preserving both ease of operation and query accuracy by eliminating the need for manual query construction.
4Loss of time
If query transformation based on join graph analysis is implemented, then query processing time is reduced, but device complexity increases
Solution Approach 1:
The patent performs preliminary analysis of the database schema to build join graphs and identify optimization opportunities before query execution. By pre-computing join relationships and potential optimization paths, the system can quickly transform and execute queries with reduced processing time, while the complexity is managed through automated schema analysis.
Data Source
AI summary
Systems and methods for query generation based on a logical data model with one-to-one joins are described. For example, methods may include accessing a join graph representing tables in a database; receiving a first query; selecting a connected subgraph of the join graph that includes the two or more tables referenced in the first query; accessing an indication that a directed edge of the connected subgraph corresponds to a one-to-one join; modifying the connected subgraph based on the indication to obtain a modified subgraph; generating one or more leaf queries based on the modified subgraph; generating a query graph that specifies joining of results from queries based on the one or more leaf queries; invoking a transformed query on the database that is based on the query graph and the queries based on the one or more leaf queries.


