Method and system for specifying, preparing and using parameterized database queries
AssigneeBusiness Objects Software Ltd.
InventorJoseph Wong
Life of this patent
Estimating the term…
Abstract
A representative parameterized query in a second database query language is generated from a parameterized query in first database query language. By randomly generating a query in the first database query language, translating this query into the second database query language, and then identifying locations of relevant parameters in the translated query, parameter placeholders can then be substituted at the identified locations to provide a parameterized query in the second database query language. A representative parameterized query in the second database query language can be selected by randomly generating multiple parameterized queries and applying statistical methods including Monte Carlo methods.
Claims36
A method of operating on database queries, comprising:
- accessing values that specify a parameterized input query in a first database query language, the parameterized input query including one or more parameters that are assigned values that specify an input query in the first database query language;
- determining, by using a processor, a plurality of randomized input queries in the first database query language by substituting a selection of random parameter values for the one or more parameters in the parameterized input query;
- determining a plurality of randomized output queries in a second database query language by translating the randomized input queries in the first database query language into corresponding randomized output queries in the second database query language;
- determining from the randomized output queries a plurality of filtered output queries in the second database query language by replacing each occurrence of the one or more parameter values from a corresponding randomized input query with a parameter placeholder, each filtered output query having a corresponding parameter-order list that identifies for each parameter placeholder a corresponding parameter from the corresponding randomized input query;
- and
- selecting a representative filtered output query from the filtered output queries by evaluating a likelihood of the representative filtered output query relative to the filtered output queries, the representative filtered output query defining a parameterized output query in the second database query language and its parameter-order list identifying a corresponding one or more parameters that are assigned values to execute the parameterized output query in the second database query language.
A computer-readable storage medium that stores a computer program for operating on database queries, wherein the computer program includes instructions that, when executed by a computer, cause the computer to perform operations comprising:
- accessing values that specify a parameterized input query in a first database query language, the parameterized input query including one or more parameters that are assigned values that specify an input query in the first database query language;
- determining a plurality of randomized input queries in the first database query language by substituting a selection of random parameter values for the one or more parameters in the parameterized input query;
- determining a plurality of randomized output queries in a second database query language by translating the randomized input queries in the first database query language into corresponding randomized output queries in the second database query language;
- determining from the randomized output queries a plurality of filtered output queries in the second database query language by replacing each occurrence of the one or more parameter values from a corresponding randomized input query with a parameter placeholder, each filtered output query having a corresponding parameter-order list that identifies for each parameter placeholder a corresponding parameter from the corresponding randomized input query;
- and
- selecting a representative filtered output query from the filtered output queries by evaluating a likelihood of the representative filtered output query relative to the filtered output queries, the representative filtered output query defining a parameterized output query in the second database query language and its parameter-order list identifying a corresponding one or more parameters that are assigned values to execute the parameterized output query in the second database query language.
An apparatus to operate on database queries, the apparatus comprising at least one computer configured to perform operations for computer-executable modules including:
- an input-query specification module configured to access values that specify a parameterized input query in a first database query language, the parameterized input query including one or more parameters that are assigned values that specify an input query in the first database query language;
- an input-query randomization module configured to determine a plurality of randomized input queries in the first database query language by substituting a selection of random parameter values for the one or more parameters in the parameterized input query;
- an output-query randomization module configured to determine a plurality of randomized output queries in a second database query language by translating the randomized input queries in the first database query language into corresponding randomized output queries in the second database query language;
- an output-query filtering module configured to determine from the randomized output queries a plurality of filtered output queries in the second database query language by replacing each occurrence of the one or more parameter values from a corresponding randomized input query with a parameter placeholder, each filtered output query having a corresponding parameter-order list that identifies for each parameter placeholder a corresponding parameter from the corresponding randomized input query;
- and
- a filtered-output selection module configured to select a representative filtered output query from the filtered output queries by evaluating a likelihood of the representative filtered output query relative to the filtered output queries, the representative filtered output query defining a parameterized output query in the second database query language and its parameter-rder list identifying a corresponding one or more parameters that are assigned values to execute the parameterized output query in the second database query language.
Dependencies are inferred from the claim text.