Methods and systems for optimizing queries in a multi-tenant store
First Claim
1. A method of optimizing database queries in a multi-tenant database system having a relational data store and a non-relational data store, the method comprising:
- receiving a request at a host system for the multi-tenant database system, the request specifying data to be retrieved from the multi-tenant database system;
retrieving, based on the request via the host system, one or more locations of the data to be retrieved;
generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store and one or more other data elements residing within the relational data store;
optimizing the database query via a query optimizer to generate an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query;
executing the optimized database query against the multi-tenant database system to retrieve the data;
wherein optimizing the database query comprises;
(i) identifying a first sub-query to a table within relational data store, the first sub-query corresponding to the first portion of the data to be retrieved, (ii) identifying a second sub-query to the non-relational data store;
the second sub-query corresponding to the second portion of the data to be retrieved, (iii) replicating the table within the relational data store to the non-relational data store, and (iv) generating the optimized database query with one or more sub-queries to fetch both the first portion of the data to be retrieved and the second portion of the data to be retrieved from the non-relational data store; and
wherein the database query comprises a specified order for two or more database join operations in which at least one of the database join operations comprises joining a child table from the non-relational data store with a master table from the relational data store and wherein optimizing the database query further comprises modifying the specified order for the two or more database join operations.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods and systems for optimizing queries in a multi-tenant store are described. In one embodiment, such a method includes retrieving data from a multi-tenant database system having a relational data store and a non-relational data store, receiving a request specifying data to be retrieved, retrieving one or more locations of the data to be retrieved, generating a database query based on the request, in which the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store and one or more other data elements residing within the relational data store, generating an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query, and executing the optimized database query against the multi-tenant database system to retrieve the data.
169 Citations
20 Claims
-
1. A method of optimizing database queries in a multi-tenant database system having a relational data store and a non-relational data store, the method comprising:
-
receiving a request at a host system for the multi-tenant database system, the request specifying data to be retrieved from the multi-tenant database system; retrieving, based on the request via the host system, one or more locations of the data to be retrieved; generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store and one or more other data elements residing within the relational data store; optimizing the database query via a query optimizer to generate an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query; executing the optimized database query against the multi-tenant database system to retrieve the data; wherein optimizing the database query comprises;
(i) identifying a first sub-query to a table within relational data store, the first sub-query corresponding to the first portion of the data to be retrieved, (ii) identifying a second sub-query to the non-relational data store;
the second sub-query corresponding to the second portion of the data to be retrieved, (iii) replicating the table within the relational data store to the non-relational data store, and (iv) generating the optimized database query with one or more sub-queries to fetch both the first portion of the data to be retrieved and the second portion of the data to be retrieved from the non-relational data store; andwherein the database query comprises a specified order for two or more database join operations in which at least one of the database join operations comprises joining a child table from the non-relational data store with a master table from the relational data store and wherein optimizing the database query further comprises modifying the specified order for the two or more database join operations. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A non-transitory computer readable storage medium having instructions stored thereon that, when executed by processor in a host system, perform a method comprising:
-
receiving a request at a host system for the multi-tenant database system, the request specifying data to be retrieved from the multi-tenant database system; retrieving one or more locations of the data to be retrieved based on the request; generating a database query based on the request, wherein the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store and one or more other data elements residing within the relational data store; optimizing the database query to generate an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query; executing the optimized database query against the multi-tenant database system to retrieve the data; wherein optimizing the database query comprises;
(i) identifying a first sub-query to a table within relational data store, the first sub-query corresponding to the first portion of the data to be retrieved, (ii) identifying a second sub-query to the non-relational data store;
the second sub-query corresponding to the second portion of the data to be retrieved, (iii) replicating the table within the relational data store to the non-relational data store, and (iv) generating the optimized database query with one or more sub-queries to fetch both the first portion of the data to be retrieved and the second portion of the data to be retrieved from the non-relational data store; andwherein the database query comprises a specified order for two or more database join operations in which at least one of the database join operations comprises joining a child table from the non-relational data store with a master table from the relational data store and wherein optimizing the database query further comprises modifying the specified order for the two or more database join operations. - View Dependent Claims (18)
-
-
19. A system comprising:
-
a processor and a memory; a communications interface to a multi-tenant database system having a relational data store and a non-relational data store implemented therein; a request processor to receive a request specifying data to be retrieved from the multi-tenant database system; a customer schema processor to retrieve, based on the request, one or more locations of the data to be retrieved; a query layer agent to generate a database query based on the request, wherein the database query specifies a plurality of data elements to be retrieved, the plurality of data elements including one or more data elements residing within the non-relational data store of the multi-tenant database system and one or more other data elements residing within the relational data store of the multi-tenant database system; a query optimizer to optimize the database query to generate an optimized database query having an optimized query syntax that is distinct from a query syntax of the database query; wherein the query layer agent to execute the optimized database query against the multi-tenant database system to retrieve the data; wherein the query optimizer to further;
(i) identify a first sub-query to a table within relational data store, the first sub-query corresponding to the first portion of the data to be retrieved, (ii) identify a second sub-query to the non-relational data store;
the second sub-query corresponding to the second portion of the data to be retrieved, (iii) replicate the table within the relational data store to the non-relational data store, and (iv) generate the optimized database query with one or more sub-queries to fetch both the first portion of the data to be retrieved and the second portion of the data to be retrieved from the non-relational data store; andwherein the database query comprises a specified order for two or more database join operations in which at least one of the database join operations comprises joining a child table from the non-relational data store with a master table from the relational data store and wherein the query optimizer is to further modify the specified order for the two or more database join operations. - View Dependent Claims (20)
-
Specification