Capturing Temporary Database Tables for Query Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Analyzing the execution plan of SQL statements containing temporary database tables is challenging due to these tables being truncated, reused, or dropped, making it impossible to analyze the execution of the SQL statement without their structure and content.

Innovation Solution

A computer-implemented method that captures temporary database tables by creating a copy of the tables before they are truncated or dropped, allowing for the generation of an updated SQL statement that references the copied tables, enabling analysis after the temporary tables are removed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If temporary database tables are truncated or dropped to enable table reuse and maintain system efficiency, then device productivity is improved, but loss of information occurs because the table structure and content are no longer available for analysis

Engineering Contradiction:
Improvesystem efficiencyVSAvoidtemporary table structure and content
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The patent creates a copy of the temporary database table before it is truncated or dropped. The copy component generates a duplicate table that preserves the structure and data of the original temporary table, allowing analysis to be performed on the copied table while the original can be safely truncated or dropped for reuse.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent performs the copying action before the truncation or drop operation. By capturing the temporary table state in advance, the system ensures that the information is preserved prior to the harmful action of truncation, resolving the contradiction between maintaining efficiency through table reuse and preserving information for analysis.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If temporary database tables are preserved to enable query execution analysis, then measurement precision is improved, but device complexity increases due to additional table management overhead

Engineering Contradiction:
Improvequery execution analysis accuracyVSAvoidtable management overhead
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

Instead of preserving the original temporary table which would complicate the system with additional management overhead, the patent creates a separate copy of the table. This copy is specifically用于 analysis purposes, allowing precise measurement of query execution without adding complexity to the core temporary table management workflow.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent separates the temporary table into two distinct instances: the original temporary table for execution and a copied table for analysis. This segmentation allows each table to serve its specific purpose independently, maintaining measurement precision while avoiding the complexity of managing a single table with multiple conflicting requirements.

Inventive Principle:
Principle #1Segmentation

3Speed

If the original temporary table is reused after truncation to maintain fast query execution, then speed is improved, but loss of information occurs because the original table data is lost

Engineering Contradiction:
Improvequery execution speedVSAvoidoriginal table data
Core Design Contradiction:
SpeedVSLoss of information

Solution Approach 1:

The patent creates a copy of the temporary table before truncation, allowing the original table to be safely truncated and reused for fast subsequent executions. The copied table retains the original data structure and content, enabling analysis without compromising the speed benefits of temporary table reuse.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The copied table acts as an intermediary that preserves the original data while allowing the original temporary table to be truncated and reused. This intermediary copy enables both goals to coexist: the original table can be quickly reused for execution while the copy preserves the information needed for analysis.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250077523A1Capturing temporary database tables for analyzing a database query
Publication Date: 2025.03.06 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20250077523A1 patent drawing
  • US20250077523A1 patent drawing
  • US20250077523A1 patent drawing

AI summary

Methods for capturing temporary database tables for analyzing a database query are provided. Aspects include obtaining a capture pattern and the database query having a sequence of statements. Aspects also include determining that a first statement of the sequence of statements matches the capture pattern, creating a list of temporary tables based on the first statement, and determining that a second statement of the sequence of statements includes one of a drop, commit, and truncate commands that correspond to a table in the list of temporary tables. Aspects further include creating a copy of the table in the list of temporary tables, generating an updated first statement by replacing a reference to the table in the list of temporary tables with a reference to the copy of the table, removing the table from the list of temporary tables, and executing the database query by performing the sequence of statements.