Query Execution Plan Optimization via Micro-Partitioning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database systems face challenges in maintaining responsive query execution times and efficient resource utilization due to the need to scan large volumes of data, which can lead to prolonged query response times and increased computing resource requirements.

Innovation Solution

The implementation of a network-based data warehouse system that utilizes micro-partitioning and metadata-based pruning to quickly identify and access relevant data, reducing the need to scan non-pertinent data and optimizing query execution through the responsive plan engine, which modifies plans based on statistics changes while imposing friction to avoid frequent changes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional database systems scan large volumes of data to execute queries, then comprehensive data analysis is achieved, but query response times increase and computing resource requirements increase

Engineering Contradiction:
Improvedata analysis completenessVSAvoidquery response time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent divides the database into micro-partitions at the storage layer and logical partitions at the query layer. This segmentation allows the system to process only relevant partition subsets rather than scanning entire tables, reducing query response time while maintaining analysis completeness through systematic partition evaluation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent pre-computes and stores partition subset metadata including statistics about data distribution, value ranges, and partition relationships. This preliminary action enables the query optimizer to quickly identify relevant partitions without scanning irrelevant data, thereby reducing query response time while ensuring comprehensive data analysis.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If traditional database systems scan large volumes of data to execute queries, then comprehensive data analysis is achieved, but computing resource usage increases

Engineering Contradiction:
Improvedata analysis completenessVSAvoidcomputing resource usage
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

By segmenting data into micro-partitions and organizing them into logical partitions, the system avoids processing irrelevant data segments. This reduces computing resource usage by focusing computational effort only on partition subsets that contain relevant data, while still achieving comprehensive analysis through systematic partition evaluation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent extracts and utilizes partition subset metadata (statistics, data distribution information, value ranges) to identify and retrieve only the necessary partition subsets for query execution. This extraction approach eliminates unnecessary data scanning and processing, reducing computing resource usage while maintaining complete data analysis through targeted partition selection.

Inventive Principle:
Principle #2Taking out (Extraction)

3Productivity

If the responsive plan engine frequently modifies query plans based on statistics changes, then query execution optimization is improved, but system stability deteriorates due to frequent plan changes

Engineering Contradiction:
Improvequery execution optimizationVSAvoidquery plan stability
Core Design Contradiction:
ProductivityVSStability of the object's composition

Solution Approach 1:

The patent implements dynamic query plan adjustment by monitoring statistics changes and modifying execution plans only when beneficial. The system dynamically evaluates whether plan changes will improve query performance before applying them, balancing optimization needs with system stability through conditional plan modification based on actual performance impact.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent applies friction to query plan changes by requiring performance improvement verification before accepting new plans. This preliminary anti-action prevents unnecessary or harmful plan changes by checking whether the new plan actually improves query execution, thereby maintaining system stability while still allowing beneficial optimizations.

Inventive Principle:
Principle #9Preliminary anti-action

Data Source

PatentUS11687531B2Estimated execution time for query execution
Publication Date: 2023.06.27 SNOWFLAKE INC
  • US11687531B2 patent drawing
  • US11687531B2 patent drawing
  • US11687531B2 patent drawing

AI summary

The subject technology tracks a plurality of queries corresponding to a plurality of query plans based on join operations contained in each of the plurality of queries and a previous time of executing each query. The subject technology selects a first query plan among the plurality of query plans. The subject technology determines a value indicating an estimated improvement in execution time of the first query plan in comparison to a previous execution time of a previous query plan. The subject technology attempts to execute a first query using the first query plan. The subject technology determines that a second query plan selected among the plurality of query plans has a second estimated execution time that is less than an estimated execution time of the first query plan. The subject technology executes the first query corresponding to the first query plan at a subsequent time using the second query plan.