State Machine Polyglot Subroutine Binding Management
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Database management systems face inefficiencies in managing polyglot subroutine bindings for long-running database commands, particularly in handling concurrency and ensuring consistent evaluation of user-defined logic, which leads to scalability issues and overhead penalties.
Innovation Solution
The implementation of state machines to manage polyglot subroutine bindings, allowing each call site to transition through operational states (initial, optimized, and unready) to efficiently acquire and release shared resources, thereby reducing overhead and ensuring consistent evaluation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional synchronization mechanisms are used to ensure consistent evaluation of user-defined functions, then reliability is improved, but device complexity and overhead increase
Solution Approach 1:
The patent implements dynamic state machines that transition between operational states (initial, optimized, unready) based on runtime conditions. This allows the system to adapt its synchronization behavior dynamically - using optimistic concurrency when possible and falling back to pessimistic locking when needed - thereby ensuring consistent evaluation while reducing overall complexity overhead
Solution Approach 2:
The patent introduces an intermediary state machine layer between the query execution engine and user-defined functions. This state machine acts as a mediator that manages bindings and synchronization, isolating the complexity of consistency guarantees from both the query optimizer and the UDF execution, thereby improving reliability without burdening the core system components
2Adaptability or versatility
If polyglot subroutine bindings are managed for long-running database commands, then adaptability is improved, but loss of time increases due to binding management overhead
Solution Approach 1:
The patent performs preliminary binding resolution during query compilation and optimization phases, before actual execution begins. State machines are pre-configured with binding information, and initial bindings are resolved in advance. This preliminary action eliminates the need for repeated binding lookups during long-running command execution, thereby supporting polyglot subroutines while minimizing time loss
Solution Approach 2:
The patent creates and maintains copies of binding information in multiple formats and locations - including parse trees, execution plans, and state machine configurations. These copies allow the system to support multiple programming languages (polyglot) without requiring repeated interpretation or resolution of binding information during execution, thereby reducing binding management overhead
3Productivity
If state machines are used to manage subroutine bindings, then productivity is improved through reduced overhead, but device complexity increases
Solution Approach 1:
The patent segments the state machine implementation into distinct, modular components - each handling specific aspects of binding management (e.g., initial state setup, optimization transitions, unready state recovery). This segmentation allows the complex state machine logic to be implemented as reusable, maintainable modules, thereby improving productivity through reduced overhead while managing implementation complexity through modular design
Data Source
AI summary
Database techniques are provided that use state machines to manage polyglot subroutine bindings for database commands. In an embodiment, a computer receives a database command that contains call sites (CSs). Each CS is associated with a user defined logic (UDL). The computer associates an initial operational state with each of the CSs. During a first invocation of a particular CS, the CS becomes initialized and transitions to an optimized state that is configured for streamlined invocation of the UDL. The UDL is invoked to contribute data to a partial result for the database command. Eventually, command execution stalls and causes the CS to transition to an unready state, which entails releasing shared resources. Later execution resumes and during another invocation of the CS, resources are reacquired, the CS is made ready and transitioned back to the optimized state. The CS may again be repeatedly invoked while revisiting the optimized state.


