SQL Association Propagation for Query Redundancy
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Standard SQL does not capture relationships between different data models, requiring repeated definitions of JOIN clauses in SQL statements to combine data from multiple database tables, which can be inefficient and error-prone.
Innovation Solution
The introduction of SQL associations, which are forward-declared JOINs that capture relationships between data models, allowing these associations to be defined once and propagated to SQL views, eliminating the need for repeated JOIN clause definitions in subsequent queries.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If JOIN clauses are repeatedly defined in SQL statements to combine data from multiple database tables, then data combination functionality is achieved, but statement complexity and redundancy increase
Solution Approach 1:
The patent applies preliminary action by pre-defining JOIN associations between data models in a preliminary registration phase. These associations are stored in the database system and automatically propagated to SQL views, eliminating the need to repeatedly define JOIN clauses in subsequent queries. The system performs the JOIN configuration work in advance, before actual query execution.
Solution Approach 2:
The patent uses copying by creating SQL associations that represent JOIN relationships as reusable templates. Instead of copying and pasting JOIN clauses manually in each SQL statement, the system automatically copies and applies the pre-defined association definitions to multiple SQL views and queries, reducing redundancy and ensuring consistency.
2Reliability
If JOIN clauses are manually defined in each SQL statement, then data combination from multiple tables is achieved, but time consumption and error probability increase
Solution Approach 1:
The patent implements self-service by enabling the database system to automatically propagate SQL associations to views and execute queries using pre-defined JOIN relationships. The system serves itself by maintaining and applying association metadata without requiring manual intervention in each query, thereby reducing errors and saving time.
Solution Approach 2:
The system uses feedback mechanisms to automatically detect and propagate SQL associations from data model definitions to SQL views. When a data model is created or modified, the system provides feedback about the associated JOIN relationships and automatically updates relevant views, ensuring consistency and reducing manual effort.
3Productivity
If SQL associations are propagated to SQL views, then redundancy of JOIN clause definitions is reduced, but processing overhead for association management is introduced
Solution Approach 1:
The patent applies segmentation by separating the JOIN logic into distinct SQL association definitions that are independent of specific queries. The association management functionality is segmented into separate components: association registration, propagation logic, and query execution. This modular approach manages complexity while improving productivity.
Data Source
AI summary
A method for propagating a structure query language (SQL) association can include determining, based at least on a syntax of a SQL create view statement, that a SQL association requires propagation to a SQL view associated with the SQL create view statement. The SQL association can combine data from at least a first data model and a second data model at a database. The SQL view can comprise at least a portion of the combined data. An association information data structure can be generated for storing information corresponding to a definition of the SQL association. The SQL create view statement can be executed based on the association information data structure. Related systems and articles of manufacture, including computer program products, are also disclose.


