Query Approximation via Dynamic Sampler Injection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current data analytics platforms face challenges in efficiently processing complex ad-hoc queries written in a mix of SQL-like relational algebra and user-defined operations, requiring substantial time and resources, especially when dealing with big-data queries that are diverse and spread across multiple datasets.

Innovation Solution

The system injects samplers into query execution plans based on error metric values, generating optimized query execution plans that approximate query outputs with controlled error rates, allowing for performance improvements without pre-existing samples, and uses a universe sampler to effectively sample join inputs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If fully processing complex ad-hoc queries is performed, then answer accuracy is maintained, but resource usage and query runtime increase substantially

Engineering Contradiction:
Improveanswer accuracyVSAvoidquery runtime
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system applies partial processing by using samplers to process only a subset of the data instead of fully processing all input data. The sampler operators selectively sample tuples from input relations based on probability distributions, enabling approximate query processing that trades off some accuracy for significant performance improvements in runtime and resource usage.

Inventive Principle:
Principle #16Partial or excessive action

2Use of energy by moving object

If samplers are injected into query execution plans, then resource usage is reduced, but query processing complexity increases

Engineering Contradiction:
Improveresource usageVSAvoidquery execution plan complexity
Core Design Contradiction:
Use of energy by moving objectVSDevice complexity

Solution Approach 1:

The system introduces sampler operators as intermediary elements within the query execution plan. These samplers act as mediators between the input data and the query processing operations, selectively sampling tuples based on probability distributions. The cost-based query optimizer automatically determines optimal sampler placements and parameters, managing the added complexity through automated optimization.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Speed

If apriori samples are stored for input data, then query processing speed improves, but storage requirements and apriori overhead increase

Engineering Contradiction:
Improvequery processing speedVSAvoidstorage requirements
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The system performs preliminary sampling actions by injecting sampler operators into the query execution plan before actual query processing occurs. However, unlike apriori sampling that pre-stores samples, this approach generates samples on-demand during query execution based on the specific query requirements, eliminating the need for pre-computed and stored sample data while still achieving speed improvements.

Inventive Principle:
Principle #10Preliminary action

4Measurement precision

If error metrics are used to control approximations, then answer quality is maintained within acceptable bounds, but computational overhead for error calculation increases

Engineering Contradiction:
Improveanswer qualityVSAvoiderror metric calculation time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system implements feedback control by calculating error metrics for different sampler configurations and using this information to guide the selection of optimal sampler parameters. The cost-based query optimizer evaluates error bounds and adjusts sampler probabilities to maintain answer quality within acceptable thresholds while minimizing processing overhead through intelligent parameter selection.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10496643B2Controlling approximations of queries
Publication Date: 2019.12.03 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10496643B2 patent drawing
  • US10496643B2 patent drawing
  • US10496643B2 patent drawing

AI summary

One or more approximations of query output in a data analytics platform are controlled. The one or more approximations are controlled by generating values of error metrics associated with placements of samplers in one or more query execution plans associated with the query, and injecting a plurality of samplers into the query execution plans, using the determined values of the error metrics, in lieu of storing samples of input to the query prior to execution of the query.