Transforming queries in a multi-tenant database system
First Claim
Patent Images
1. A method for optimizing a query by a database system in a multi-tenant database system, the method comprising:
- receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula;
accessing an index generated to correspond to one tenant of the multi-tenant database system;
preprocessing the formula in the query predicate based upon the generated index for the tenant to create a transformed query request, wherein the preprocessing includes;
applying the generated index to a database field referenced in the formula, andreplacing at least one reference to a database field within the formula with a reference to a second database field based upon the generated index;
optimizing the query request using the transformed query request;
receiving a query request with a reference to a first database field in the query predicate, wherein the first database field comprises the formula in the query predicate, wherein the formula comprises a reference to a second database field; and
transforming the query request to a transformed query request by replacing the reference to the first database field within the query request with at least one reference to the second database field.
1 Assignment
0 Petitions
Accused Products
Abstract
In a method, system, and computer-readable medium having instructions for optimizing a query in a database system, a query request is received with a query predicate to filter data returned in response to the query request and the query predicate has a formula, the query request is transformed to a transformed query request by preprocessing the formula in the query predicate, and the query request is optimized using the transformed query request.
-
Citations
15 Claims
-
1. A method for optimizing a query by a database system in a multi-tenant database system, the method comprising:
-
receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula; accessing an index generated to correspond to one tenant of the multi-tenant database system; preprocessing the formula in the query predicate based upon the generated index for the tenant to create a transformed query request, wherein the preprocessing includes; applying the generated index to a database field referenced in the formula, and replacing at least one reference to a database field within the formula with a reference to a second database field based upon the generated index; optimizing the query request using the transformed query request; receiving a query request with a reference to a first database field in the query predicate, wherein the first database field comprises the formula in the query predicate, wherein the formula comprises a reference to a second database field; and transforming the query request to a transformed query request by replacing the reference to the first database field within the query request with at least one reference to the second database field. - View Dependent Claims (2, 4, 5, 6)
-
-
3. A method for optimizing a query in a multi-tenant database system, the method comprising:
-
receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula; accessing an index generated to correspond to one tenant of the multi-tenant database system; preprocessing the formula in the query predicate based upon the generated index for the tenant to create a transformed query request, wherein the preprocessing includes; applying the generated index to a database field referenced in the formula, and replacing at least one reference to a database field within the formula with a reference to a second database field based upon the generated index; optimizing the query request using the transformed query request by determining a selective filter, selecting indexes, choosing where to apply hash joins and/or nested loop joins, and determine where to perform a full table order; receiving a query request with a reference to a first database field in the query predicate, wherein the first database field comprises the formula in the query predicate, wherein the formula comprises a reference to a second database field; and transforming the query request to a transformed query request by replacing the reference to the first database field within the query request with at least one reference to the second database field.
-
-
7. A non-transitory computer-readable storage medium having one or more instructions thereon for optimizing a query in a multi-tenant database system, the instructions when executed by one or more processors causing the one or more processors to carry out:
-
receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula; accessing an index generated to correspond to one tenant of the multi-tenant database system; preprocessing the formula in the query predicate based upon the generated index for the tenant to create a transformed query request, wherein the preprocessing includes; applying the generated index to a database field referenced in the formula, and replacing at least one reference to a database field within the formula with a reference to a second database field based upon the generated index; optimizing the query request using the transformed query request; receiving a query request with a reference to a first database field in the query predicate, wherein the first database field comprises the formula in the query predicate, wherein the formula comprises a reference to a second database field; and transforming the query request to a transformed query request by replacing the reference to the first database field within the query request with at least one reference to the second database field. - View Dependent Claims (8, 9, 10)
-
-
11. A system for optimizing a query in a multi-tenant database system, the system comprising:
-
a processor; and one or more stored sequences of instructions which, when executed by the processor, cause the processor to; receiving a query request with a query predicate to filter data returned in response to the query request, wherein the query predicate comprises a formula; generating an index corresponding to one tenant of the multi-tenant database system; preprocessing the formula in the query predicate based upon the generated index for the tenant to create a transformed query request, wherein the preprocessing includes; applying the generated index to a database field referenced in the formula, replacing at least one reference to a database field within the formula with a reference to a second database field based upon the generated index; and optimizing the query request using the transformed query request, receiving a query request with a reference to a first database field in the query predicate, wherein the first database field comprises the formula in the query predicate, wherein the formula comprises a reference to a second database field; and transforming the query request to a transformed query request by replacing the reference to the first database field within the query request with at least one reference to the second database field. - View Dependent Claims (12, 13, 14, 15)
-
Specification