Polymorphic Query Processing via TYPEOF Expressions
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional query languages lack mechanisms to efficiently handle very large queries, leading to system bottlenecks and interrupting smooth execution of other queries, especially in large databases used by growing organizations.
Innovation Solution
The introduction of polymorphic relationships through the TYPEOF expression in the SOQL SELECT clause allows for efficient data selection based on the type of parent object, reducing latency and enabling batch processing techniques to handle large queries effectively.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional query languages are used to handle very large queries, then the system can process data from huge databases, but the system becomes bottlenecked and execution of other queries is interrupted
Solution Approach 1:
The patent segments large queries into smaller batches using batch processing techniques. The query processor divides complex queries involving huge databases into multiple manageable batches, processes them sequentially or in parallel, and aggregates results. This prevents system bottlenecks by avoiding overload from monolithic query execution while maintaining high throughput through efficient batch management.
2Reliability
If traditional query languages process very large queries, then complete data retrieval is achieved, but computation time increases and system resources are consumed
Solution Approach 1:
The patent extracts and applies polymorphic relationships through TYPEOF expressions to selectively filter and process data based on parent object types. Instead of retrieving all data and filtering client-side, the system extracts only relevant fields based on type conditions in the query itself, reducing computation time while maintaining complete and accurate data retrieval through type-specific field selection.
Solution Approach 2:
The patent performs preliminary data filtering and type checking through TYPEOF expressions in the query definition stage. By pre-specifying type conditions and relevant fields before execution, the system prepares optimized query plans that reduce computation time during actual data retrieval while ensuring complete and accurate results through pre-validating type constraints.
3Productivity
If polymorphic relationships with TYPEOF expressions are implemented, then query efficiency is enhanced and computation time is reduced, but query language complexity increases
Solution Approach 1:
The patent introduces dynamic type checking and field selection through TYPEOF expressions that evaluate parent object types at query execution time. This dynamic approach allows the query language to adapt to different data types and structures within polymorphic relationships, enhancing query efficiency through type-specific optimization while managing complexity through a unified expression syntax that works across multiple object types.
Data Source
AI summary
Techniques for providing polymorphic query requests. A request is received that has at least a database query. The database query comprises at least an expression using a polymorphic relationship. The request is processed utilizing the polymorphic relationship. A user-readable result is provided for the query where the result is defined by at least the polymorphic relationship.


