Methods and systems for joining indexes for query optimization in a multi-tenant database
First Claim
1. A computer-implemented method of improving a query that is to be performed in the context of a tenant-specific filter on a tenant identifier, the method comprising:
- receiving at a network interface of a server an original query, wherein the original query is associated with data within a database as identified by the tenant identifier, and wherein the database includes at least a first index and a second index, further wherein the database stores data for multiple tenants that are unrelated organizations and have different database schemas, the data corresponding to each tenant having tenant-specific characteristics;
retrieving, using a processor of the server, metadata associated with the data, wherein at least a portion of the data is stored in a common table within the database system;
determining, using the processor, a tenant-selective query syntax by analyzing at least metadata generated from tenant-specific characteristics;
analyzing, using the processor, metadata generated from information about the organization to which the original query corresponds; and
generating, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index and the analysis of the metadata.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods and systems for query optimization for a multi-tenant database system are provided. Some embodiments comprise receiving at a network interface of a server in a multi-tenant database system an original query transmitted to the multi-tenant database system by a user associated with a tenant, wherein the original query is associated with data accessible by the tenant, and wherein the multi-tenant database system includes at least a first index and a second index. Metadata associated with the data is retrieved, wherein at least a portion of the data is stored in a common table within the multi-tenant database system. A tenant-selective query syntax is determined by analyzing at least one of metadata generated from information about the tenant or metadata generated from the data accessible by the tenant. An improved query is then generated using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index.
160 Citations
45 Claims
-
1. A computer-implemented method of improving a query that is to be performed in the context of a tenant-specific filter on a tenant identifier, the method comprising:
-
receiving at a network interface of a server an original query, wherein the original query is associated with data within a database as identified by the tenant identifier, and wherein the database includes at least a first index and a second index, further wherein the database stores data for multiple tenants that are unrelated organizations and have different database schemas, the data corresponding to each tenant having tenant-specific characteristics; retrieving, using a processor of the server, metadata associated with the data, wherein at least a portion of the data is stored in a common table within the database system; determining, using the processor, a tenant-selective query syntax by analyzing at least metadata generated from tenant-specific characteristics; analyzing, using the processor, metadata generated from information about the organization to which the original query corresponds; and generating, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index and the analysis of the metadata. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. A non-transitory computer-readable medium containing program code executable by a processor in a computer configurable to cause the computer to improve a query in a multi-tenant database system that is to be performed in the context of a tenant-specific filter on a tenant identifier, the program code including instructions to:
-
receiving at a network interface of a server an original query, wherein the original query is associated with data within a database as identified by the tenant identifier, and wherein the database includes at least a first index and a second index, further wherein the database stores data for multiple tenants that are unrelated organizations and have different database schemas, the data corresponding to each tenant having tenant-specific characteristics; retrieving, using a processor of the server, metadata associated with the data, wherein at least a portion of the data is stored in a common table within the database system; determining, using the processor, a tenant-selective query syntax by analyzing at least metadata generated from tenant-specific characteristics; analyzing, using the processor, metadata generated from information about the organization to which the original query corresponds; and generating, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index and the analysis of the metadata. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)
-
-
25. A system for improving a query in a multi-tenant database system that is to be performed in the context of a tenant-specific filter on a tenant identifier, the system comprising:
-
a processor; a network interface; and a computer-readable medium tangibly embodied with instructions capable of configuring the processor to; receive at a network interface of a server an original query, wherein the original query is associated with data within a database as identified by the tenant identifier, and wherein the database includes at least a first index and a second index, further wherein the database stores data for multiple tenants that are unrelated organizations and have different database schemas, the data corresponding to each tenant having tenant-specific characteristics; retrieve, using a processor of the server, metadata associated with the data, wherein at least a portion of the data is stored in a common table within the database system; determine, using the processor, a tenant-selective query syntax by analyzing at least metadata generated from tenant-specific characteristics; analyze, using the processor, metadata generated from information about the organization to which the original query corresponds; and generate, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index and the analysis of the metadata. - View Dependent Claims (26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36)
-
-
37. A computer-implemented method of improving a query that is to be performed in the context of a tenant-specific filter on a tenant identifier, the method comprising:
-
receiving at a network interface of a server an original query, wherein the original query is associated with data within a database as identified by the tenant identifier, and wherein the database includes at least a first index and a second index, further wherein the database stores data for multiple tenants that are unrelated organizations and have different database schemas, the data corresponding to each tenant having tenant-specific characteristics; retrieving metadata associated with the data accessible by the tenant in a multi-tenant database system, wherein at least a portion of the data accessible by the tenant is stored in a common table within the multi-tenant database system; scanning, using a processor of the server, a first index column to identify a first set of rows, wherein the first index column is selected based on the original query; scanning, using the processor, a second index column to identify a second set of rows, wherein the second index column is selected based on the original query; determining, using the processor, an intersection of the first set of rows and the second set of rows to identify a third set of rows; determining, using the processor, a tenant-selective query syntax by analyzing at least metadata generated from tenant-specific characteristics; analyzing, using the processor, metadata generated from information about the organization to which the original query corresponds; and generating, using the processor, an improved query using the query syntax, wherein the improved query is based at least in part upon the original query and a result of a join between a first number of rows associated with the first index and a second number of rows associated with the second index and the analysis of the metadata. - View Dependent Claims (38, 39, 40, 41, 42, 43, 44, 45)
-
Specification