Static query optimization
First Claim
1. A computer-implemented method for tuning queries for a multi-tenant database system, the method comprising:
- retrieving actual statistics associated with data stored on one or more servers in the multi-tenant database system, wherein the data is associated with one or more tenants of the multi-tenant database system;
selecting a subset of the actual statistics, wherein the subset of the actual statistics is related to tenants having a data trait targeted for optimization, wherein a tenant having a data trait targeted for optimization has at least one of the following data traits;
(1) a high volume of transactions, (2) a high number of transactions involving large file sizes, (3) a high number of resource-intensive transactions, (4) high utilization of a rarely-used column or table, or (5) high utilization of a rarely-used resource;
determining, using one or more processors associated with the one or more servers, synthetic statistics based on the subset of the actual statistics, wherein the synthetic statistics are derived from the subset of actual statistics by modifying one or more aspects of the data based on a subset of the tenants of the multi-tenant database system, the subset of tenants having the data trait targeted for optimization, and then re-calculating statistical data to generate the synthetic statistics;
receiving an original query transmitted to the multi-tenant database system by a user associated with a tenant that has the data trait targeted for optimization, wherein the original query operates upon data associated with the tenant; and
determining, using the processor, an optimal query plan based on the original query and the synthetic statistics.
1 Assignment
0 Petitions
Accused Products
Abstract
In some embodiments, a computer-implemented method for tuning queries for a multi-tenant database system is provided. A processor retrieves actual statistics associated with data stored on one or more servers in the multi-tenant database system. The data may be associated with one or more tenants of the multi-tenant database system. A subset of the actual statistics is selected, wherein the subset of the actual statistics is related to tenants having a data trait targeted for optimization. The processor determines synthetic statistics based on the subset of the actual statistics. An original query is received at the multi-tenant database system, wherein the original query operates upon data associated with a tenant that has the data trait targeted for optimization. The processor determines an optimal query plan based on the original query and synthetic statistics. Finally, the processor executes the original query based on the optimal query plan.
-
Citations
19 Claims
-
1. A computer-implemented method for tuning queries for a multi-tenant database system, the method comprising:
-
retrieving actual statistics associated with data stored on one or more servers in the multi-tenant database system, wherein the data is associated with one or more tenants of the multi-tenant database system; selecting a subset of the actual statistics, wherein the subset of the actual statistics is related to tenants having a data trait targeted for optimization, wherein a tenant having a data trait targeted for optimization has at least one of the following data traits;
(1) a high volume of transactions, (2) a high number of transactions involving large file sizes, (3) a high number of resource-intensive transactions, (4) high utilization of a rarely-used column or table, or (5) high utilization of a rarely-used resource;determining, using one or more processors associated with the one or more servers, synthetic statistics based on the subset of the actual statistics, wherein the synthetic statistics are derived from the subset of actual statistics by modifying one or more aspects of the data based on a subset of the tenants of the multi-tenant database system, the subset of tenants having the data trait targeted for optimization, and then re-calculating statistical data to generate the synthetic statistics; receiving an original query transmitted to the multi-tenant database system by a user associated with a tenant that has the data trait targeted for optimization, wherein the original query operates upon data associated with the tenant; and determining, using the processor, an optimal query plan based on the original query and the synthetic statistics. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer-implemented method for executing optimized queries in a multi-tenant database system, the method comprising:
-
receiving an original query transmitted to one or more servers of the multi-tenant database system, wherein the original query operates upon data associated with a tenant of a plurality of tenants of the multi-tenant database system, wherein the tenant has a data trait targeted for optimization; retrieving synthetic statistics, wherein the synthetic statistics are based on actual statistics associated with one or more tenants of the multi-tenant database system, and wherein the one or more tenants have the data trait targeted for optimization, wherein a tenant having a data trait targeted for optimization has at least one of the following data traits;
(1) a high volume of transactions, (2) a high number of transactions involving large file sizes, (3) a high number of resource-intensive transactions, (4) high utilization of a rarely-used column or table, or (5) high utilization of a rarely-used resource;determining, using one or more processors associated with the one or more servers, synthetic statistics based on the subset of the actual statistics, wherein the synthetic statistics are derived from the subset of actual statistics by modifying one or more aspects of the data, and then re-calculating statistical data to generate the synthetic statistics based on a subset of the tenants of the multi-tenant database system, the subset of tenants having the data trait targeted for optimization; executing, using the one or more processors, an optimal query plan based on the synthetic statistics. - View Dependent Claims (9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A non-transitory computer-readable medium containing program code executable by a processor in a computer to tune a query, the program code including instructions to:
-
retrieve actual statistics associated with data stored on one or more servers in the multi-tenant database system, wherein the data is associated with one or more tenants of the multi-tenant database system; select a subset of the actual statistics, wherein the subset of the actual statistics is related to tenants having a data trait targeted for optimization, wherein a tenant having a data trait targeted for optimization has at least one of the following data traits;
(1) a high volume of transactions, (2) a high number of transactions involving large file sizes, (3) a high number of resource-intensive transactions, (4) high utilization of a rarely-used column or table, or (5) high utilization of a rarely-used resource;determine, using one or more processors associated with the one or more servers, synthetic statistics based on the subset of the actual statistics, wherein the synthetic statistics are derived from the subset of actual statistics by modifying one or more aspects of the data, and then re-calculating statistical data to generate the synthetic statistics based on a subset of the tenants of the multi-tenant database system, the subset of tenants having the data trait targeted for optimization; receive an original query transmitted to the multi-tenant database system by a user associated with a tenant that has the data trait targeted for optimization, wherein the original query operates upon data associated with the tenant; and generate, using the processor, an optimal query plan based on the original query and the synthetic statistics.
-
-
18. A system comprising:
-
one or more processors; and a memory encoded with instructions to configure the one or more processors to; retrieve actual statistics associated with data stored on one or more servers in the multi-tenant database system, wherein the data is associated with one or more tenants of the multi-tenant database system; select a subset of the actual statistics, wherein the subset of the actual statistics is related to tenants having a data trait targeted for optimization, wherein a tenant having a data trait targeted for optimization has at least one of the following data traits;
(1) a high volume of transactions, (2) a high number of transactions involving large file sizes, (3) a high number of resource-intensive transactions, (4) high utilization of a rarely-used column or table, or (5) high utilization of a rarely-used resource;determine, using one or more processors associated with the one or more servers, synthetic statistics based on the subset of the actual statistics, wherein the synthetic statistics are derived from the subset of actual statistics by modifying one or more aspects of the data, and then re-calculating statistical data to generate the synthetic statistics based on a subset of the tenants of the multi-tenant database system, the subset of tenants having the data trait targeted for optimization; receive an original query transmitted to the multi-tenant database system by a user associated with a tenant that has the data trait targeted for optimization, wherein the original query operates upon data associated with the tenant; generate, using the processor, an optimal query plan based on the original query and the synthetic statistics; and
execute the original query based on the optimal query plan. - View Dependent Claims (19)
-
Specification