Join Histogram Construction with Q-Error Guarantees

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing query optimization methods face challenges in accurately determining cardinality estimates for join queries due to unbounded estimation errors and inefficiencies in constructing histograms, which can impact the performance of database management systems.

Innovation Solution

The development of algorithms that build a join histogram from input histograms over different attributes without accessing the base data or computing the join relation, ensuring error guarantees and efficient computation, allowing for accurate cardinality estimation of queries.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If histograms are built by accessing data via data scan, then accurate cardinality estimates can be obtained, but construction efficiency deteriorates due to the cost of data scanning

Engineering Contradiction:
Improvecardinality estimate accuracyVSAvoidhistogram construction efficiency
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent pre-computes and stores single-column histograms for individual attributes before the join operation occurs. These pre-built histograms contain statistical information about data distribution, frequencies, and selectivity. When a join query is executed, the query optimizer can directly use these pre-computed histograms to estimate join cardinality without performing expensive data scans, thus resolving the contradiction between accuracy and efficiency.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If previous methods are used to determine cardinality estimates, then the process can be completed, but unbounded estimation errors occur

Engineering Contradiction:
Improvecardinality determination capabilityVSAvoidestimation error bound
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent introduces join histograms as an intermediary data structure that bridges single-column histograms and join cardinality estimation. The join histogram is constructed by combining information from multiple single-column histograms using algorithms that model the correlation between attributes. This intermediary structure enables bounded error guarantees in cardinality estimation by providing a more sophisticated representation than simple product of selectivities, while avoiding the need for expensive data scans.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If join histograms are constructed without accessing base data, then computational cost is reduced, but error guarantees must be maintained

Engineering Contradiction:
Improvecomputation efficiencyVSAvoiderror guarantee
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent creates join histograms by copying and combining statistical information from pre-computed single-column histograms rather than scanning the actual base data. The algorithm copies frequency distributions, selectivity values, and other statistical metrics from the input histograms, then combines them using mathematical models that account for attribute correlations. This copying approach maintains computational efficiency while preserving error bounds because the statistical properties are transferred and transformed rather than re-computed from raw data.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10565286B2Constructing join histograms from histograms with Q-error guarantees
Publication Date: 2020.02.18 SAP SE
  • US10565286B2 patent drawing
  • US10565286B2 patent drawing
  • US10565286B2 patent drawing

AI summary

Disclosed herein are system, method, and computer program product embodiments for generating join histograms. An embodiment operates by a computer implemented method that includes determining, by at least one processor, a first interval associated with a first histogram of a first data structure and a first estimate frequency associated with the first interval. The method further includes determining, by the at least one processor, a second interval associated with a second histogram of a second data structure and a second estimate frequency associated with the second interval. The method further includes determining, by the at least one processor, a join interval based on the first and second intervals by calculating an intersection of the first and second intervals. The method further includes calculating, by the at least one processor, a join estimate frequency based on the first and second estimate frequencies.