Database Batch Update via UNION ALL View
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing database update methods cannot batch-update multiple SQL statements across different tables due to data type and column compatibility issues, limiting performance improvements.
Innovation Solution
The technique involves configuring a UNION ALL view to map and update multiple SQL statements by creating a unified view of data types, tables, and WHERE clause columns, allowing for batch updates across different tables with compatible data types and constraints.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If batch-update is used for a single SQL statement, then database performance is improved, but updates covering multiple tables cannot be batch-updated
Solution Approach 1:
The patent merges multiple SQL statements targeting different tables into a single batch update operation by creating a UNION ALL view that combines the result sets of multiple tables. This allows the database engine to process all updates in one operation rather than executing separate update statements for each table, thereby maintaining high performance while extending batch update capability to multi-table scenarios.
Solution Approach 2:
The UNION ALL view acts as an intermediary structure that bridges multiple tables with different schemas. By mapping columns from different tables to a unified view structure, the patent enables the batch update mechanism to operate on heterogeneous table structures through this intermediate layer, resolving the limitation that prevented multi-table batch updates.
2Productivity
If multiple queries are composed into one operation, then database performance is improved, but data type compatibility issues arise across different tables
Solution Approach 1:
The patent applies local quality by allowing each table to maintain its own data type characteristics while participating in the unified batch update. The UNION ALL view maps columns from different tables to a common structure, where each column position corresponds to a specific data type requirement. This enables the batch update to proceed with type-safe operations while preserving the heterogeneity of source table schemas.
Solution Approach 2:
The patent transforms the parameter structure of multiple SQL statements by mapping their parameters to a unified parameter set in the UNION ALL view. This parameter transformation allows the batch update mechanism to handle varying data types across tables by reorganizing parameters into a consistent structure that the database engine can process uniformly, thereby resolving data type compatibility issues.
Data Source
AI summary
Techniques for batch-updating one or more structured query language (SQL) statements in a database are provided. The techniques include identifying a set of one or more data types, wherein the set comprises one or more columns that are each updated, respectively, by a SQL statement, identifying a set of one or more tables, wherein each of the one or more tables are updated, respectively, by a SQL statement, identifying a set of one or more columns used in a WHERE clause of each of one or more SQL statements, and batch-updating the one or more SQL statements, wherein batch-updating comprises creating a UNION ALL view comprising the set of one or more data types, the set of one or more tables and the set of one or more columns used in a WHERE clause, and wherein each SQL statement is mapped to each set of the UNION ALL view.


