Embodiments of the present invention relate to a method, computer program product and system for optimizing database transactions configured for receiving a query. The query specifies a set of predicates supplied to the query and a minimal number of predicates to be satisfied for the query to be true. An operation using the query is performed on a repository that is stored in a computer readable storage medium. A set of results satisfying the minimal number of predicated is rendered.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A computer implemented method for optimizing database transactions, comprising: receiving a query, the query specifying (i) a set of predicates supplied to the query and (ii) a minimal number of predicates in the set to be satisfied for a data record to be returned in a query result set; forming a bitwise predicate pattern for each of one of the specified predicates, including forming a unique set of bits for each one of the bitwise predicate patterns, each of the sets of bits having the same number of bits and having only one of the bits turned ON, such that each one of the bitwise predicate patterns uniquely represents a respective one of the predicates, and including forming the set of bits for each one of the bitwise predicate patterns such that the bit that is ON in a set of bits indicates which one of the predicates corresponds to which one of the bitwise predicate patterns; generating a logical expression using the sets of bits of the bitwise predicate patterns; performing operations on the logical expression to optimize the query, thereby producing an optimized query; using the optimized query on a repository stored in a computer readable storage medium to find a set of results satisfying the minimal number of predicates; and rendering the set of results satisfying the minimal number of predicates.
2. The computer implemented method as claimed in claim 1 , wherein receiving the query includes receiving the query as a statement in the form “ATLEAST (N, p 1 , p 2 , p 3 , . . . pK),” wherein p 1 to pK is the set of predicates supplied to the query, and wherein N is a number having a value in a range from 1 through K indicating the minimal number of predicates to be satisfied for a data record to be returned in a query result set.
3. The computer implemented method as claimed in claim 1 , wherein the minimal number of predicates is a pre-defined threshold for the query to operate.
4. The computer implemented method as claimed in claim 1 , wherein the repository comprises a structured data.
5. The computer implemented method as claimed in claim 1 , wherein the query is in the form of Structured Query Language (SQL).
6. A computer program product comprising a non-transitory computer readable storage medium including computer usable code for optimizing database transactions, the computer usable code comprising: computer usable code for receiving a query, the query specifying (i) a set of predicates supplied to the query and (ii) a minimal number of predicates in the set to be satisfied for a data record to be returned in a query result set; computer usable code for forming a bitwise predicate pattern for each of one of the specified predicates, including forming a unique set of bits for each one of the bitwise predicate patterns, each of the sets of bits having the same number of bits and having only one of the bits turned ON, such that each one of the bitwise predicate patterns uniquely represents a respective one of the predicates, and including forming the set of bits for each one of the bitwise predicate patterns such that the bit that is ON in a set of bits indicates which one of the predicates corresponds to which one of the bitwise predicate patterns; computer usable code for generating a logical expression using the sets of bits of the bitwise predicate patterns; computer usable code for performing operations on the logical expression to optimize the query, thereby producing an optimized query; computer usable code for using the optimized query on a repository stored in a computer readable storage medium to find a set of results satisfying the minimal number of predicates; and computer usable code for rendering the set of results satisfying the minimal number of predicates.
7. The computer program product as claimed in claim 6 , wherein receiving the query includes receiving the query as a statement in the form “ATLEAST (N, p 1 , p 2 , p 3 , . . . pK),” wherein p 1 to pK is the set of predicates supplied to the query, and wherein N is a number having a value in a range from 1 through K indicating the minimal number of predicates to be satisfied for a data record to be returned in a query results set.
8. The computer program product as claimed in claim 6 , wherein the minimal number of predicates is a pre-defined threshold for the query to operate.
9. The computer program product as claimed in claim 6 , wherein the repository comprises a structured data.
10. The computer program product as claimed in claim 6 , wherein the query is in the form of Structured Query Language (SQL).
11. The computer program product of claim 6 , wherein the computer usable code is stored in a computer readable storage medium in a data processing system, and wherein the computer usable code is transferred over a network from a remote data processing system.
12. The computer program product of claim 6 , wherein the computer usable code is stored in a computer readable storage medium in a server data processing system, and wherein the computer usable code is downloaded over a network to a remote data processing system for use in a computer readable storage medium associated with the remote data processing system.
13. A data processing system for optimizing database transactions, the data processing system comprising: a storage device including a storage medium, wherein the storage device stores computer usable program code; and a processor, wherein the processor executes the computer usable program code, and wherein the computer usable program code comprises: computer usable code for receiving a query, the query specifying (i) a set of predicates supplied to the query and (ii) a minimal number of predicates in the set to be satisfied for a data record to be returned in a query result set; computer usable code for forming a bitwise predicate pattern for each of one of the specified predicates, including forming a unique set of bits for each one of the bitwise predicate patterns, each of the sets of bits having the same number of bits and having only one of the bits turned ON, such that each one of the bitwise predicate patterns uniquely represents a respective one of the predicates, and including forming the set of bits for each one of the bitwise predicate patterns such that the bit that is ON in a set of bits indicates which one of the predicates corresponds to which one of the bitwise predicate patterns; computer usable code for generating a logical expression using the sets of bits of the bitwise predicate patterns; computer usable code for performing operations on the logical expression to optimize the query, thereby producing an optimized query; computer usable code for using the optimized query on a repository stored in a computer readable storage medium to find a set of results satisfying the minimal number of predicates; and computer usable code for rendering the set of results satisfying the minimal number of predicates.
14. The data processing system as claimed in claim 13 , wherein receiving the query includes receiving the query as a statement in the form “ATLEAST (N, p 1 , p 2 , p 3 , . . . pK),” wherein p 1 to pK is the set of predicates supplied to the query, and wherein N is a number having a value in a range from 1 through K I indicating the minimal number of predicates to be satisfied for a data record to be returned in a query result set.
15. The data processing system as claimed in claim 13 , wherein the minimal number of predicates is a pre-defined threshold for the query to operate.
16. The data processing system as claimed in claim 13 , wherein the repository comprises a structured data.
17. The data processing system as claimed in claim 13 , wherein the query is in the form of Structured Query Language (SQL).
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
November 19, 2010
February 14, 2017
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.