Query Rewriting for Soft Time Constraints

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large databases with complex queries face issues with long processing times, making it challenging for users to optimize queries within a predictable time frame, especially with the sophistication of SQL queries involving joins, grouping, and sub-queries, where conventional approaches require user intelligence and may produce unpredictable results.

Innovation Solution

The system supports time-constrained queries by accepting a soft time constraint and transforming queries to produce partial or approximate results, using techniques like ROWNUM or SAMPLE clauses to reduce result set cardinality or sample size, with analytics to estimate execution time and adjust query optimization modes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If conventional query optimization strategies are used to return first-few rows or sample rows, then query processing speed is improved, but query execution time becomes unknown or unpredictable

Engineering Contradiction:
Improvequery processing speedVSAvoidquery execution time predictability
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The system changes the parameter of query execution by introducing a time constraint parameter that transforms the query optimization problem. Instead of optimizing for speed alone, the system optimizes for execution time within a specified bound, making the execution time predictable while still achieving reasonable processing speed through adaptive query rewriting.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system dynamically rewrites queries based on the specified time constraint. The query transformation is not static but adapts to the time requirement, adjusting the query plan dynamically to ensure execution completes within the bound while maintaining optimization effectiveness.

Inventive Principle:
Principle #15Dynamics

2Adaptability or versatility

If complex SQL queries with joins, grouping, and sub-queries are executed, then query flexibility and information completeness are improved, but query execution time increases significantly

Engineering Contradiction:
Improvequery flexibilityVSAvoidquery execution duration
Core Design Contradiction:
Adaptability or versatilityVSDuration of action of moving object

Solution Approach 1:

The system applies partial action by rewriting queries to return sufficient results within the time constraint without requiring complete execution of all query operations. It performs the necessary joins, groupings, and sub-queries only to the extent needed to satisfy the time bound while maintaining result quality.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The system changes query parameters such as join strategies, grouping methods, and sub-query execution approaches to reduce execution duration while preserving query flexibility. It transforms the original query into an optimized version that maintains adaptability but executes faster within the specified time constraint.

Inventive Principle:
Principle #35Parameter changes

3Loss of time

If users manually optimize queries to meet time constraints, then query execution time control is improved, but system complexity and user burden increase

Engineering Contradiction:
Improvequery execution time controlVSAvoidsystem complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The system provides self-service by automatically rewriting queries to meet time constraints without requiring user intervention. The query optimization process is handled autonomously by the system, which analyzes the time constraint and transforms the query accordingly, eliminating the need for users to manually optimize complex queries.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system acts as an intermediary between the user's query intent and the database execution engine. It receives the original query, transforms it to meet time constraints through automated rewriting, and submits the optimized version for execution, thereby controlling execution time without increasing user burden or system complexity.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS7953728B2Queries with soft time constraints
Publication Date: 2011.05.31 ORACLE INT CORP
  • US7953728B2 patent drawing
  • US7953728B2 patent drawing
  • US7953728B2 patent drawing

AI summary

Systems, methodologies, media, and other embodiments associated with supporting queries with soft time constraints are described. One exemplary system embodiment includes logic for accepting a query having a soft time constraint. The example system may also include logic for rewriting the query having the soft time constraint into a query having a row limitation or a sample percentage limitation. In one example, the row limitation or sample percentage limitation are computed by repetitively comparing an estimated query execution time to the soft time constraint.