Query Analyzer Metadata Statistics 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 dynamically selecting and applying rules based on historical data and metadata statistics, preventing full table scans and promoting efficient data access.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If synchronous queries are executed on large datasets (hundreds of millions to billions of rows), then complete data retrieval is achieved, but query response time becomes unpredictable and timeout situations occur

Engineering Contradiction:
Improvequery completionVSAvoidquery response time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by collecting metadata statistics (row counts, data sizes, distribution patterns) before queries are executed. This advance preparation enables the query analyzer to predict query performance and identify potentially inefficient queries before they run, preventing timeout situations while ensuring complete data retrieval when appropriate.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a query analyzer as an intermediary component between the query execution system and the database. This intermediary evaluates queries against collected metadata statistics, predicts performance outcomes, and provides guidance on query optimization without preventing the actual data retrieval process when needed.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If full table scans are performed to ensure complete data retrieval, then accurate query results are obtained, but resource consumption increases and response time becomes unpredictable

Engineering Contradiction:
Improvequery accuracyVSAvoidquery processing efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system implements feedback mechanisms by continuously collecting metadata statistics from actual query executions and using this information to improve future query analysis. The query analyzer learns from historical performance data and metadata patterns to better predict which queries will benefit from optimization and which require full table scans for accurate results.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes parameters by utilizing metadata statistics (row counts, data sizes, distribution patterns) as additional parameters for query evaluation. These parameters enable the system to make informed decisions about query execution strategies, balancing between full table scans for accuracy and optimized paths for efficiency.

Inventive Principle:
Principle #35Parameter changes

3Loss of time

If query optimization rules are applied to improve response time, then efficient query execution is achieved, but system complexity increases due to rule management

Engineering Contradiction:
Improvequery response timeVSAvoidquery processing system
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The system applies self-service principles by automatically collecting metadata statistics and using them to generate query optimization recommendations without requiring manual intervention. The query analyzer autonomously evaluates queries against collected statistics and provides optimization guidance, reducing the complexity burden on users while maintaining efficient query execution.

Inventive Principle:
Principle #25Self-service

4Loss of time

If metadata statistics collection is implemented to enable query optimization, then query performance predictability improves, but data processing overhead increases

Engineering Contradiction:
Improvequery response time predictabilityVSAvoiddata processing energy
Core Design Contradiction:
Loss of timeVSUse of energy by moving object

Solution Approach 1:

The system applies partial action by collecting metadata statistics selectively rather than comprehensively for all data. It focuses on gathering essential statistics (row counts, data sizes, distribution patterns) that provide sufficient information for query optimization without the overhead of complete data analysis, achieving good predictability with reduced processing energy.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS11314741B2Metadata-based statistics-oriented processing of queries in an on-demand environment
Publication Date: 2022.04.26 SALESFORCE INC
  • US11314741B2 patent drawing
  • US11314741B2 patent drawing
  • US11314741B2 patent drawing

AI summary

In accordance with embodiments, there are provided mechanisms and methods for facilitating metadata-based statistics-oriented query processing for large datasets in an on-demand services environment. In one embodiment and by way of example, a method comprises evaluating metadata associated with a query placed on behalf of a tenant in a multi-tenant environment, and computing process statistics for the query based on the metadata, where the process statistics reveal an estimation of resources needed for execution of the query within a predictable amount of time and using fewer than or equal to an allocated number of scans of a database. The method may further include associating, based on the process statistics, a set of rules and the estimated resources to process the query, and executing the query based on the set of rules and using the estimated resources such that the query is processed within the predictable amount of time and using fewer than or equal to the allocated number of scans of the database.