Multi-Aggregate User-Defined Function Reducing Database Query Overhead

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems are limited by the single return value policy of user-defined functions (UDFs), which requires multiple UDFs to be written and executed separately for each aggregate value, leading to inefficiencies and resource overhead, especially when executed outside the data store system.

Innovation Solution

Implementing a data store system with a processor array that can perform a single read of rows associated with multiple aggregates using a multi-aggregate UDF, allowing each aggregate to be generated from these rows, thereby reducing the need for multiple UDF calls and improving performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If multiple separate aggregate functions are written and executed one-by-one to obtain multiple aggregate values, then each aggregate value can be calculated accurately, but the number of UDF calls increases significantly and system performance degrades

Engineering Contradiction:
Improveaggregate value accuracyVSAvoidquery execution efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent combines multiple separate aggregate function calls into a single UDF invocation that returns multiple aggregate values simultaneously. Instead of executing max(), min(), and avg() as separate functions requiring three distinct UDF calls, the system implements a single UDF that computes all three aggregates in one execution pass, merging what were previously separate operations into one unified operation.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a universal UDF framework that can handle multiple aggregate functions through a single call. The enhanced UDF is designed to be multi-functional, capable of computing different aggregate values (maximum, minimum, average, etc.) within a single execution context, eliminating the need for multiple specialized function calls.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Reliability

If UDFs are executed in protected mode outside the data store system to protect from errors, then data store system reliability is improved, but resource overhead increases due to repeated transmission of qualified rows

Engineering Contradiction:
Improvedata store system protectionVSAvoidresource overhead
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent merges multiple separate UDF executions into a single execution that processes all aggregate computations together. By combining what would have been three separate protected-mode executions into one, the system transmits each qualified row outside the data store system only once instead of multiple times, reducing the cumulative resource overhead while maintaining the protective isolation.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent enables continuous processing of multiple aggregates within a single UDF execution context. Rather than interrupting the processing flow to transmit and re-transmit rows for each separate aggregate function, the system maintains continuous action by computing all aggregates in one uninterrupted pass through the data, minimizing I/O operations.

Inventive Principle:
Principle #20Continuity of useful action

3Device complexity

If a single return value policy is enforced for UDFs, then the system maintains simplicity in function design, but multiple aggregates require multiple separate functions increasing development complexity

Engineering Contradiction:
Improvefunction design simplicityVSAvoidUDF development convenience
Core Design Contradiction:
Device complexityVSEase of manufacture

Solution Approach 1:

The patent implements a universal UDF design that breaks the single-return-value limitation by enabling functions to return multiple aggregate values simultaneously. This multi-functional approach allows a single UDF to handle multiple aggregate computations, reducing the number of functions developers must write and maintain while preserving design simplicity through a unified interface.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent transitions from a single-dimension return value model to a multi-dimension output model. Instead of forcing developers to create separate functions for each aggregate (one dimension per function), the system allows a single function to return multiple dimensions of aggregate data, changing the dimensional structure of function outputs and simplifying the development landscape.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS10282449B1Multiple aggregates in a single user-defined function
Publication Date: 2019.05.07 TERADATA US INC
  • US10282449B1 patent drawing
  • US10282449B1 patent drawing
  • US10282449B1 patent drawing

AI summary

A data store system may include a persistent storage device that may store a plurality of data tables. The data store system may further include a processor array in communication with the persistent storage device. The processor array may receive a query comprising a call to a user-defined function (UDF) that may determine a plurality of aggregates for at least one data table from the plurality of data tables. The processor array may determine a number of the plurality of aggregates in the UDF. The processor array may perform a single read of rows associated with the plurality aggregates from the at least one data table. At least one row of the rows may be commonly associated with more than one of the plurality of aggregates. The processor array may generate each aggregate of the plurality of aggregates using the rows according to the UDF. A method and computer-readable medium may also be implemented.