APPROXIMATING QUERY RESULTS BY RELATIONS OVER TYPES FOR ERROR DETECTION AND OPTIMIZATION
First Claim
1. A computer-implemented method for approximating any results returned by a query over a relational data source, the method comprising:
- receiving, at a computer system, a set of types, wherein a type in the set of types represents a superset of a set of values that is storable in that field;
receiving, at the computer system, a type for each field in a schema, wherein the schema describes a relational data source to be searched;
producing, at the computer system, at least one approximation of at least one result returned by a query, wherein the query includes calls to other query procedures, and wherein the approximation includes at least one of a set of records of types and a set of records of Boolean formulas over types, wherein each field in the result occurs as a field in a record of types, and each type assigned to a field represents a superset of the set of values that are storable in that field; and
optimizing, at the computer system, by transforming the other query procedures using the approximation by eliminating query parts that return an empty set of results regardless of the contents of the relational data source in a context where the query parts are called.
5 Assignments
0 Petitions
Accused Products
Abstract
A method and system is provided for computing an approximation of the results of a query. The approximation represents a superset of all possible results, by computing a set of records of types (as opposed to a set of records of values, which is the normal result of a query). This is different from conventional systems, which typically infer types for each field individually. For each record of types, one may also keep track of equalities of fields to improve the precision of the approximation. The approximation can be used to detect erroneous parts of queries that always return an empty result, regardless of the contents of the data source. Furthermore, the same approximation is also useful in performing optimizations: first, by eliminating parts of procedure calls that are guaranteed to be irrelevant to the calling context, and second, by eliminating unnecessary type tests in the query.
18 Citations
31 Claims
-
1. A computer-implemented method for approximating any results returned by a query over a relational data source, the method comprising:
-
receiving, at a computer system, a set of types, wherein a type in the set of types represents a superset of a set of values that is storable in that field; receiving, at the computer system, a type for each field in a schema, wherein the schema describes a relational data source to be searched; producing, at the computer system, at least one approximation of at least one result returned by a query, wherein the query includes calls to other query procedures, and wherein the approximation includes at least one of a set of records of types and a set of records of Boolean formulas over types, wherein each field in the result occurs as a field in a record of types, and each type assigned to a field represents a superset of the set of values that are storable in that field; and optimizing, at the computer system, by transforming the other query procedures using the approximation by eliminating query parts that return an empty set of results regardless of the contents of the relational data source in a context where the query parts are called. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)
-
-
30. A system for approximating the result returned by a query over a relational data source, the system comprising:
-
a memory; a processor communicatively coupled to the memory; and a compiler communicatively coupled to the memory and the processor, wherein the compiler is adapted to; receive a set of types, wherein a type in the set of types represents a superset of a set of values that is storable in that field; receive a type for each field in a schema, wherein the schema describes a relational data source to be searched; produce at least one approximation of at least one result returned by a query, wherein the query includes calls to other query procedures, and wherein the approximation includes at least one of a set of records of types and a set of records of Boolean formulas over types, wherein each field in the result occurs as a field in a record of types, and each type assigned to a field represents a superset of the set of values that are storable in that field; and optimize by transforming the other query procedures using the approximation by eliminating query parts that return an empty set of results regardless of the contents of the relational data source in a context where the query parts are called.
-
-
31. A computer program product for approximating the result returned by a query over a relational data source, the computer program product comprising instructions for:
-
receiving a set of types, wherein a type in the set of types represents a superset of a set of values that is storable in that field; receiving a type for each field in a schema, wherein the schema describes a relational data source to be searched; producing at least one approximation of at least one result returned by a query, wherein the query includes calls to other query procedures, and wherein the approximation includes at least one of a set of records of types and a set of records of Boolean formulas over types, wherein each field in the result occurs as a field in a record of types, and each type assigned to a field represents a superset of the set of values that are storable in that field; and optimizing by transforming the other query procedures using the approximation by eliminating query parts that return an empty set of results regardless of the contents of the relational data source in a context where the query parts are called.
-
Specification