# US 2016/0253377 A1 · Database query execution tracing and data generation for diagnosing execution issues

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0253377 A1
- Document ID: US20160253377A1
- Status: Published application
- Kind: A1
- Application number: 15/055,551
- Filed: 2016-02-27
- Published: 2016-09-01
- Earliest claimed: 2015-02-26
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: James A. Ford; Lakshman R. Sakaray; Paul-John A. To
- Web page: https://patentgrep.com/patent/US20160253377A1

## CPC

- G06F 16/2453: Query optimisation
- G06F 11/362: Debugging of software
- G06F 16/2425: {Iterative querying; Query formulation based on the results of a preceding query}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Trace data is received that was captured for an execution of a first query on first input data. The trace data associates clauses of the first query with respective evaluation states that arise during the execution. Second input data is generated from the trace data without accessing the first input data. An execution of a second query is performed on the second input data, wherein performing the execution of the second query on the second input data reproduces evaluation states from the execution of the first query on the first input data.

## Claims

### Claim 1

A method comprising:
receiving trace data captured for an execution of a first query on first input data, wherein the trace data associates clauses of the query with respective evaluation states that arise during the execution;
generating second input data from the trace data without accessing the first input data, so that the first input data is kept private; and
performing an execution of a second query on the second input data, wherein performing the execution of the second query on the second input data reproduces evaluation states from the execution of the first query on the first input data.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first input data include data values and generating the second input data from the trace data without accessing the first input data comprises:
generating values for the second input data corresponding to respective ones of the first input data values, wherein each second input data value has a value such that in execution of the second query each second input data value produces the same evaluation state as the evaluation state captured in the trace data for the corresponding first input data value, but is otherwise independent of the corresponding first input data value.

### Claim 3 (depends on 1)

The method of claim 1, wherein the trace data includes counts of respective combinations of the evaluation states from the execution of the first query applying the clauses of the first query to rows of the first input data.

### Claim 4 (depends on 3)

The method of claim 3, wherein generating the second input data from the trace data without accessing the first input data comprises:
generating random values constrained to ranges such that executing the second query on the second input data reproduces the same number of combinations for a predetermined type of the evaluation state combinations.

### Claim 5 (depends on 3)

The method of claim 3, wherein the evaluation states from the execution of the first query on the first input data include an unevaluated state, wherein each instance of the unevaluated state occurs from an instance of not applying a query clause to an input data row.

### Claim 6 (depends on 3)

The method of claim 3, wherein the evaluation states from the execution of the first query on the first input data include one or more of a true, false and under-evaluation state, wherein each instance of the true, false and under-evaluation states occurs from an instance of applying one of the query clauses to a row of the first input data.

### Claim 7 (depends on 1)

The method of claim 1, wherein generating the second input data from the trace data without accessing the first input data comprises:
generating data that cause the execution of the second query to reproduce true evaluation states of the execution on the first query excluding unevaluated evaluation states of the first execution.

### Claim 8 (depends on 1)

The method of claim 1, comprising:
determining whether a union result of the evaluation states in the trace data is true for each clause in the first query.

### Claim 9 (depends on 8)

The method of claim 8, comprising:
generating the second query from the first query, wherein generating the second query includes eliminating a clause from the first query when the union result for the clause being eliminated is not true.

### Claim 10 (depends on 9)

The method of claim 9, wherein generating the alternative input data responsive to the trace data and the schema for the first input data comprises:
generating data that cause the execution of the second query to reproduce evaluation states of the execution of the first query only for the clauses having a true union state.

### Claim 11 (depends on 1)

The method of claim 1, wherein the clauses of the query comprise any one or more of a join filter, a predicate and an index.
