Database Query Analysis Using SQL Text Normalization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Comparing and analyzing database query statistics across different databases is challenging due to variations in SQL IDs, query formats, and schemas, making it difficult to obtain a true picture of performance metrics.

Innovation Solution

An intelligent tool that maps SQL IDs to SQL text and parameters, allowing for comparison of queries across different databases by evaluating extra data, creating output files, and storing them in a statistics repository, enabling accurate analysis and detection of query changes regardless of software versions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of operation

If SQL IDs are used to identify and compare queries across databases, then query comparison becomes simpler, but accuracy deteriorates because SQL IDs differ even for functionally identical queries

Engineering Contradiction:
Improvequery comparison simplicityVSAvoidquery identification accuracy
Core Design Contradiction:
Ease of operationVSMeasurement precision

Solution Approach 1:

The patent uses SQL text and parameters as an intermediary representation to compare queries. Instead of directly comparing SQL IDs (which are database-specific identifiers), the system maps queries to a common representation using SQL text and normalized parameters, enabling accurate cross-database query comparison while maintaining operational simplicity

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent transforms query identification from using database-specific SQL IDs to using normalized SQL text and parameters. By changing the identification parameters to a standardized format that is independent of specific database implementations, the system achieves both accurate query matching and ease of comparison across different databases

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If detailed SQL text and parameters are collected for analysis, then query comparison accuracy improves, but data processing complexity increases

Engineering Contradiction:
Improvequery comparison accuracyVSAvoiddata processing complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent performs preliminary normalization and standardization of SQL text and parameters before comparison. By pre-processing the data to establish a common representation format and normalize parameters in advance, the system reduces the complexity of subsequent comparison operations while maintaining high accuracy

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent segments query analysis into distinct components: SQL text extraction, parameter normalization, and comparison operations. By dividing the complex task into manageable segments with dedicated processing steps for each component, the system handles detailed data without overwhelming complexity

Inventive Principle:
Principle #1Segmentation

3Adaptability or versatility

If queries are compared across different software versions, then adaptability improves, but reliability of comparison deteriorates due to format variations

Engineering Contradiction:
Improvecross-version comparison capabilityVSAvoidcomparison consistency
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent creates a universal comparison framework that works across different software versions and database systems. By designing a normalized representation system that abstracts away version-specific formats and uses consistent SQL text and parameter structures, the system achieves both cross-version adaptability and reliable, consistent comparison results

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

Data Source

PatentUS9898383B2Techniques and mechanisms for managing and analyzing database query activities
Publication Date: 2018.02.20 SALESFORCE INC
  • US9898383B2 patent drawing
  • US9898383B2 patent drawing
  • US9898383B2 patent drawing

AI summary

Techniques and mechanisms for analyzing a plurality of database queries within a database environment. A first statistical evaluation of a first query plan is determined for a first database query with at least one computing device within the database environment. A second statistical evaluation for a second query plan is determined for a second database query. The first statistical evaluation and the second statistical evaluation are compared to determine whether the first query plan matches the second query plan with at least one computing device within the database environment. An indication is stored in a repository of the database environment that the first query matches the second query if the first hash value matches the second hash value. A function that provides the first query plan is determined. If the second query plan is provided by the function that provides the first query plan, data objects referenced by the first query plan and the second query plan if the function provides both the first query plan and the second query plan to determine if the first query plan and the second query plan are syntactically different versions of equivalent database queries. Query statistics are stored in the statistical repository if the first query plan and the second query plan are syntactically different versions of equivalent database queries.