Database Query Interceptor for N-Query Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software testing struggles to detect and address the 'N-Query problem, where applications unnecessarily query a database multiple times for the same data, leading to inefficiencies and decreased system throughput.

Innovation Solution

A method is introduced to intercept database queries, generate parametric forms, and detect N-Query issues by identifying queries that can be optimized into a single query, generating an exception when multiple queries with similar forms exceed a threshold, and reporting this as a unit test failure.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If multiple select queries are executed to retrieve data for N different objects (e.g., N customers), then the application can obtain the required data, but the system performs N separate database queries instead of one, reducing throughput and efficiency

Engineering Contradiction:
Improvesystem throughputVSAvoidnumber of database queries
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent merges N separate select queries into a single database query by combining the query conditions. Instead of executing N individual queries to retrieve data for N different customers, the system generates one consolidated query that retrieves all required data in a single operation, thereby improving system throughput and reducing database query overhead

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a universal query template that can serve multiple purposes. By parameterizing the select query with placeholders (e.g., ?) and using a single query structure that can retrieve data for any N objects, the system achieves multi-functionality where one query pattern handles multiple data retrieval scenarios, eliminating the need for N separate queries

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

2Reliability

If traditional software testing methods are used, then basic functionality can be verified, but N-Query problems cannot be detected

Engineering Contradiction:
Improvedetection capabilityVSAvoidtesting complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary component (query interceptor/detector) that sits between the application code and the database. This intermediary intercepts select queries, analyzes their parametric forms, and detects N-Query problems by identifying when N similar queries are executed for N different objects. This mediator enables detection capability without requiring changes to the core application logic

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces manual code review and traditional testing mechanisms with an automated detection system. Instead of relying on developers to manually identify N-Query problems through code inspection, the system uses automated query interception and parametric form analysis to detect issues, substituting mechanical manual processes with automated computational detection

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS9779180B2Detection of the N-queries via unit test
Publication Date: 2017.10.03 SUCCESSFACTORS INC
  • US9779180B2 patent drawing
  • US9779180B2 patent drawing
  • US9779180B2 patent drawing

AI summary

In one aspect, there is provided a method. The method may include intercepting a request including one or more select queries sent to a database; generating a parametric form for each of one or more select queries; processing the parametric form to determine whether the one or more select queries cause an n-query issue comprising multiple selects, when executed at the database; and indicating an exception, when the one or more select queries cause the n-query issue. Related systems, methods, and articles of manufacture are also disclosed.