SQL Query Optimization Using Vector Embeddings and Partitioning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional database systems face inefficiencies in processing SQL queries due to high processing time, memory requirements, and repeated calculations, especially when dealing with large relational tables containing a vast number of unique values, which leads to suboptimal performance and memory usage.

Innovation Solution

The implementation of vector embedding techniques to create semantic models that capture latent context, integrated with SQL infrastructure, allows for optimized query processing by selecting techniques based on unique value counts, using clustering and batching to reduce unnecessary calculations and memory usage, and reusing similarity calculations for duplicate values.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If conventional SQL query processing is used on large relational tables, then complete data coverage is achieved, but processing time and memory requirements increase significantly

Engineering Contradiction:
Improvedata coverageVSAvoidquery processing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent segments the large relational table into multiple partitions based on the distribution of unique values in the queried column. Instead of processing the entire table, the system divides it into manageable segments and processes only relevant partitions, thereby reducing processing time while maintaining data coverage through systematic segmentation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary actions by pre-computing and storing statistics about data distribution, unique value counts, and partition characteristics. These pre-computed metrics enable the query optimizer to make informed decisions about which partitions to access, avoiding full table scans and reducing query processing time.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If conventional SQL query processing is used on large relational tables, then all data is processed, but memory requirements increase significantly

Engineering Contradiction:
Improvedata completenessVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent segments the large relational table into multiple partitions based on the distribution of unique values in the queried column. Instead of processing the entire table, the system divides it into manageable segments and processes only relevant partitions, thereby reducing processing time while maintaining data coverage through systematic segmentation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system extracts and processes only the necessary partitions containing relevant data, rather than loading the entire table into memory. By taking out only the required subsets of data based on partition pruning and statistics, memory requirements are significantly reduced while data completeness is maintained for the queried scope.

Inventive Principle:
Principle #2Taking out (Extraction)

3Productivity

If semantic models with vector embedding are integrated into SQL infrastructure, then query optimization is enabled, but system complexity increases

Engineering Contradiction:
Improvequery performanceVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent integrates semantic modeling capabilities directly into the existing SQL infrastructure, allowing the same system to handle both traditional SQL queries and semantic-enhanced queries. This multi-functionality enables query optimization through vector embedding without requiring separate systems, thereby managing complexity while improving productivity.

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

Solution Approach 2:

The system introduces semantic models as an intermediary layer between the SQL query engine and the data. This mediator translates SQL queries into semantic representations using vector embedding, enables optimized query execution, and returns results in the original SQL format, thereby improving performance while managing complexity through a dedicated intermediary component.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20240220488A1Optimizing structured query language queries using candidate sets
Publication Date: 2024.07.04 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20240220488A1 patent drawing
  • US20240220488A1 patent drawing
  • US20240220488A1 patent drawing

AI summary

A count of unique values in a column of a database table is determined. A query on the database table is performed, wherein a technique for performing the query is selected based on the count of unique values.