Optimizing cursor loops in relational database systems using custom aggregates
AssigneeMicrosoft Technology Licensing, LLC
InventorsKarthik Saligrama Ramachandra, Surabhi Gupta, Sanket Jayant Purandare
Life of this patent
Estimating the term…
Loading patent…
AssigneeMicrosoft Technology Licensing, LLC
InventorsKarthik Saligrama Ramachandra, Surabhi Gupta, Sanket Jayant Purandare
Estimating the term…
Methods and systems are provided for converting a loop (e.g., a cursor loop) to a declarative Structured Query Language (SQL) query that invokes a custom aggregate function. The loop includes a select query and a loop body that includes a program fragment that can be evaluated over a result set of the select query one row at a time. The system verifies that the loop body does not modify a persistent state of the database. A custom aggregate function that expresses the loop body is automatically constructed according to a contract. An aggregate class comprising aggregation methods of the contract are used to construct the aggregate function based on results of static analysis. The select query is automatically rewritten to form a declarative SQL query that invokes the custom aggregate function. The declarative SQL query may be executed by a database management system (DBMS) SQL server.
A system for converting a loop to a declarative structure query language (SQL) query that invokes a custom aggregate function, the system comprising:
A method for converting a loop to a declarative structure query language (SQL) query that invokes a custom aggregate function, the method comprising:
A method for converting a FOR loop comprising a fixed iteration space to a declarative structured query language (SQL) query that invokes a custom aggregate function, the method comprising:
Dependencies are inferred from the claim text.