Dynamic Query Rule Selection for Predictable Response Times

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional database systems face challenges in predicting query times for large datasets, leading to unpredictable and frustrating user experiences due to inefficient query processing, especially when dealing with hundreds of millions to billions of rows, resulting in timeout situations and variable response times for the same queries.

Innovation Solution

A rules-based synchronous query processing technique is implemented, where queries are processed through a Query Analyzer that applies a series of rules to block inefficient query patterns, ensuring only optimal queries are executed within predictable time frames by selecting and applying dynamic rules based on metadata statistics and historical performance patterns.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If conventional database systems process queries on large datasets, then data retrieval functionality is provided, but query response times become unpredictable and variable

Engineering Contradiction:
Improvequery response time predictabilityVSAvoidquery execution consistency
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The system performs preliminary actions by collecting metadata statistics about data distribution, query patterns, and system performance before actual query execution. This pre-computed information is stored and used to generate accurate cost estimates and predict query response times, eliminating the unpredictability of conventional systems.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system implements feedback mechanisms by continuously monitoring actual query performance and comparing it with predicted performance. This feedback is used to refine metadata statistics and improve the accuracy of cost estimates over time, enhancing query execution consistency and reliability.

Inventive Principle:
Principle #23Feedback

2Quantity of substance

If full table scans are performed on large datasets, then complete data retrieval is achieved, but timeout situations occur and productivity decreases

Engineering Contradiction:
Improvedata retrieval completenessVSAvoidquery execution speed
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The system segments the data retrieval process by using metadata statistics to identify and prioritize relevant data partitions or segments. Instead of scanning the entire table, queries are directed to specific segments that are likely to contain the required data, maintaining retrieval completeness while dramatically improving execution speed.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system changes parameters by using cost estimates based on metadata statistics to dynamically adjust query execution parameters. This includes selecting optimal access paths, filtering criteria, and execution strategies that balance data retrieval completeness with execution efficiency, preventing timeouts.

Inventive Principle:
Principle #35Parameter changes

3Quantity of substance

If data sets grow larger to accommodate more information, then data capacity increases, but query processing time and resource consumption increase

Engineering Contradiction:
Improvedata storage capacityVSAvoidquery processing time
Core Design Contradiction:
Quantity of substanceVSLoss of time

Solution Approach 1:

As data sets grow, the system performs preliminary actions by continuously collecting and updating metadata statistics about the expanding data. This pre-computed information enables the system to efficiently handle queries on large datasets by providing accurate cost estimates and optimized execution plans, preventing processing time from increasing proportionally with data size.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system introduces metadata statistics as an intermediary layer between the growing data sets and query processing operations. This intermediary provides summarized information about data distribution and characteristics, enabling efficient query execution on large datasets without requiring direct examination of all data, thus reducing processing time.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Speed

If synchronous queries are executed on large datasets, then real-time results are provided, but timeout situations and variable response times occur

Engineering Contradiction:
Improvequery response speedVSAvoidquery completion guarantee
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

Before executing synchronous queries, the system performs preliminary cost estimation using metadata statistics to predict query completion time and resource requirements. This allows the system to accept or reject queries based on whether they can complete within acceptable time frames, providing real-time results with guaranteed reliability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses feedback from actual query execution performance to refine its cost estimation models. This continuous improvement ensures that synchronous query predictions become increasingly accurate, maintaining both fast response speeds and high reliability guarantees even as data sets grow and system conditions change.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11068483B2Dynamic selection and application of rules for processing of queries in an on-demand environment
Publication Date: 2021.07.20 SALESFORCE INC
  • US11068483B2 patent drawing
  • US11068483B2 patent drawing
  • US11068483B2 patent drawing

AI summary

In accordance with embodiments, there are provided mechanisms and methods for facilitating dynamic selection and application for rules for query processing for large datasets in an on-demand services environment according to one embodiment. In one embodiment and by way of example, a method comprises determining processing patterns of a query based on historical performances associated with the query placed on behalf of a tenant in a multi-tenant environment, and dynamically applying one or more rules to the query for processing of the query within a predictable amount of time, where the one or more rules are dynamically selected from sets of rules based on the processing patterns. The method may further include executing the query based on the one or more rules by scanning one or more portions of a database having contents pertinent to the query and generating results by processing the query based on the contents and within the predictable amount of time.