Monotonic Aggregation in Recursive Queries

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query languages, such as SQL and Datalog, do not guarantee convergence to a fixed point when recursive queries contain non-monotonic aggregation functions, leading to the exclusion of recursive aggregates and requiring auxiliary queries for aggregation, which are space-inefficient.

Innovation Solution

The introduction of monotonic aggregation constructs, denoted as agg*, allows aggregation functions to be embedded directly in the recursive term of recursive definitions, ensuring that fixed points exist and aggregation is performed during query execution, reducing space requirements.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If non-monotonic aggregation functions are used in recursive queries, then aggregation capability is improved, but convergence to fixed point is not guaranteed

Engineering Contradiction:
Improveaggregation capabilityVSAvoidconvergence guarantee
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent transforms the aggregation function parameter from non-monotonic to monotonic. Specifically, it uses monotonic aggregation functions (such as MAX, MIN, COUNT) that satisfy the property: if input set A ⊆ input set B, then aggregation(A) ≤ aggregation(B). This parameter change ensures that the recursive query evaluation converges to a fixed point while maintaining aggregation capability.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If aggregation is performed after recursive query execution, then correctness is improved, but space efficiency deteriorates

Engineering Contradiction:
Improveaggregation correctnessVSAvoidspace consumption
Core Design Contradiction:
Measurement precisionVSQuantity of substance

Solution Approach 1:

The patent performs aggregation during the recursive query execution process itself, rather than as a separate post-processing step. The monotonic aggregation function is applied at each iteration of the recursive evaluation, allowing the system to compute aggregated values incrementally as the fixed point is approached, thereby avoiding the need to materialize the entire result table in memory.

Inventive Principle:
Principle #10Preliminary action

3Adaptability or versatility

If auxiliary queries are used for aggregation, then aggregation flexibility is improved, but query complexity deteriorates

Engineering Contradiction:
Improveaggregation flexibilityVSAvoidquery structure
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent merges the aggregation operation with the recursive query definition by allowing the monotonic aggregation function to be embedded directly in the recursive term. This combination eliminates the need for separate auxiliary queries while maintaining aggregation flexibility, as the aggregation is performed as an integral part of the recursive evaluation process.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS9418111B1Recursive aggregates
Publication Date: 2016.08.16 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9418111B1 patent drawing
  • US9418111B1 patent drawing
  • US9418111B1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for expressing and evaluating aggregation functions, including aggregation functions in the context of recursive aggregates, in data languages that implement fixed point semantics. One of the methods includes receiving input specifying, explicitly or implicitly, an aggregation function agg having an input type and an output type, a relation s that has a domain and a range and that represents one or more entities to be aggregated over, and a relation t that is a relation from the range of s to the input type of the aggregation function agg; and evaluating an aggregation construct agg* to calculate a relation between the domain of s and the output type of the aggregation function agg according to agg*(s,t)={(m,agg(n))|∃d:(m,d)εs,nεΠ{|t(y)|yεs(m)|}}.