Data Model View Complex Calculation Framework
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current data models in database layers are unable to handle complex calculations efficiently, especially when dealing with high data volumes, as they require reimplementation of logic or processing results outside the database layer, leading to performance issues.
Innovation Solution
A framework that performs complex calculations in the application layer using an application programming language, generating intermediate results stored in a global temporary table, which are then used by the data model view in the database layer to calculate target results, effectively combining application logic with database processing capabilities.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If complex calculation logic is re-implemented within the data model view in the database layer, then the data model can handle complex calculations, but the performance deteriorates because the database layer is not optimized for complex calculations
Solution Approach 1:
The calculation process is segmented into two parts: complex calculation logic is implemented as an object in the application layer, while the data model view in the database layer handles data retrieval and result assembly. This segmentation allows each layer to perform its optimized function - application layer for complex logic and database layer for efficient data access.
Solution Approach 2:
A global temporary table serves as an intermediary between the application layer and the data model view. The application layer object writes intermediate calculation results to this temporary table, which the data model view then reads to generate final results. This intermediary mechanism enables seamless integration of application logic with database processing.
2Adaptability or versatility
If results from the data model view are processed again in the application layer, then customized complex calculations can be performed, but performance deteriorates because the application layer is not optimized for handling large data volumes
Solution Approach 1:
The processing workflow is segmented such that the data model view in the database layer handles bulk data retrieval and initial processing, while the application layer object handles only the complex calculation logic on the retrieved data. This reduces the data volume processed in the application layer while maintaining complex calculation capability.
Solution Approach 2:
The data model view performs preliminary data retrieval and preparation in the database layer before data is transferred to the application layer. This preliminary action reduces the amount of data that needs to be processed in the application layer, improving overall performance while enabling complex calculations.
3Adaptability or versatility
If application logic is inserted before or after the execution of the data model, then both application programming language capabilities and database processing can be utilized, but it is not possible to invoke application logic within the execution of the data model view
Solution Approach 1:
The application layer object is invoked in advance to perform complex calculations and store results in a global temporary table before the data model view execution. This preliminary action enables the data model view to access pre-computed intermediate results during its execution, effectively integrating application logic within the data model workflow.
Solution Approach 2:
The global temporary table acts as an intermediary that bridges the application layer and the data model view. By storing intermediate results in this temporary table, the system enables the data model view to access application logic outputs during its execution, achieving seamless integration between the two layers.
Data Source
AI summary
Described herein is a framework for providing data model views with complex calculation capability. In accordance with one aspect, the framework receives a request to calculate target results. An object in an application layer may be invoked to perform complex calculation to generate intermediate results. The intermediate results are stored in a global temporary table. A data model view in a database layer may then be invoked to calculate the target results based on the intermediate results retrieved from the global temporary table. The calculated target results are then returned.


