Pruning Index Micro-Partitioning for Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Processing queries on very large tables is challenging due to the significant time and computing resources required to scan the entire table to identify data that satisfies the query, necessitating a more efficient approach to reduce scanning efforts.

Innovation Solution

The creation of a pruning index that organizes data into micro-partitions and uses probabilistic data structures like blocked bloom filters to quickly identify pertinent micro-partitions for scanning, thereby reducing the scan set and optimizing query processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a full table scan is performed to identify data satisfying the query, then all data can be examined to ensure query accuracy, but significant time and computing resources are consumed

Engineering Contradiction:
Improvequery accuracyVSAvoidquery execution time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the large table into multiple micro-partitions based on prefix ranges of the indexed column. Each micro-partition contains data with similar prefix values, allowing the query processor to scan only relevant micro-partitions that could contain matching data, rather than scanning the entire table. This segmentation dramatically reduces the scan set while maintaining query accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary action by pre-computing and storing prefix information for each micro-partition in a pruning index before query execution. This pre-processing creates a metadata structure that enables rapid identification of relevant micro-partitions during query processing, avoiding the need to examine all data during the actual query execution.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If the entire table is scanned to ensure complete data retrieval, then query completeness is maintained, but computing resources are significantly consumed

Engineering Contradiction:
Improvequery completenessVSAvoidcomputing resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The table is divided into micro-partitions with associated prefix ranges stored in the pruning index. The query processor uses these prefix ranges to identify and scan only the minimal subset of micro-partitions that could contain data satisfying the query predicates, ensuring completeness while minimizing resource consumption.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The pruning index acts as an intermediary structure between the query and the underlying table data. It contains pre-computed prefix information that mediates the query processing by quickly identifying relevant data regions, thereby reducing the need to examine unrelated data and lowering computing resource consumption.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Loss of time

If traditional indexing methods are used to speed up query processing, then query execution time is reduced, but the index structure becomes complex and difficult to maintain

Engineering Contradiction:
Improvequery execution timeVSAvoidindex structure complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent segments the indexing task by creating micro-partitions based on prefix ranges rather than using complex traditional index structures like B-trees or hash indexes. Each micro-partition is associated with a simple prefix range in the pruning index, making the overall structure easier to understand, maintain, and optimize compared to traditional complex indexing methods.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11704320B2Processing queries using an index generated based on data segments
Publication Date: 2023.07.18 SNOWFLAKE INC
  • US11704320B2 patent drawing
  • US11704320B2 patent drawing
  • US11704320B2 patent drawing

AI summary

A table organized into a set of batch units is accessed. A set of N-grams are generated for a data value in the source table. The set of N-grams include a first N-gram of a first length and a second N-gram of a second length where the first N-gram corresponds to a prefix of the second N-gram. A set of fingerprints are generated for the data value based on the set of N-grams. The set of fingerprints include a first fingerprint generated based on the first N-gram and a second fingerprint generated based on the second N-gram and the first fingerprint. A pruning index that indexes distinct values in each column of the source table is generated based on the set of fingerprints and stored in a database with an association with the source table.