Methods and systems for optimizing queries in a multi-tenant store
First Claim
1. A method of optimizing database queries in a 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 database system, the request specifying data for retrieval from the database system;
retrieving, based on the request via the host system, one or more locations of the data for retrieval;
generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements for retrieval, the plurality of data elements including a first portion of the data residing within the non-relational data store and a second portion of the data residing within the relational data store;
optimizing the database query to include a join operation specifying a plurality of sub-queries to join the first portion of the data and the second portion of the data into a joined data set responsive to the request;
wherein optimizing the database query further includes;
(i) identifying a first sub-query to a table within the relational data store corresponding to the first portion of the data for retrieval, (ii) identifying a second sub-query to the non-relational data store corresponding to the second portion of the data for retrieval, (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 for retrieval and the second portion of the data for retrieval from the non-relational data store;
wherein optimizing the database query by (iii) replicating the table within the relational data store to the non-relational data store further comprises optimizing the database query based on a policy to replicate a smaller dataset from its primary location to a location having the larger dataset in fulfillment of the replication; and
executing the optimized database query against the database system to retrieve the data.
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.
201 Citations
19 Claims
-
1. A method of optimizing database queries in a 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 database system, the request specifying data for retrieval from the database system; retrieving, based on the request via the host system, one or more locations of the data for retrieval; generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements for retrieval, the plurality of data elements including a first portion of the data residing within the non-relational data store and a second portion of the data residing within the relational data store; optimizing the database query to include a join operation specifying a plurality of sub-queries to join the first portion of the data and the second portion of the data into a joined data set responsive to the request; wherein optimizing the database query further includes;
(i) identifying a first sub-query to a table within the relational data store corresponding to the first portion of the data for retrieval, (ii) identifying a second sub-query to the non-relational data store corresponding to the second portion of the data for retrieval, (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 for retrieval and the second portion of the data for retrieval from the non-relational data store;wherein optimizing the database query by (iii) replicating the table within the relational data store to the non-relational data store further comprises optimizing the database query based on a policy to replicate a smaller dataset from its primary location to a location having the larger dataset in fulfillment of the replication; and executing the optimized database query against the database system to retrieve the data. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A system to optimize database queries for a database system,
wherein the system comprises: -
a processor and a memory; a communications interface to the database system, wherein the database system includes both a relational data store and a non-relational data store implemented therein; a request processor to receive a request at the host system for a database system, the request specifying data for retrieval from the database system;
a customer schema processor to retrieve, based on the request, one or more locations of the data for retrieval;a query layer agent to generate a database query based on the request, wherein the database query specifies a plurality of data elements for retrieval, the plurality of data elements including a first portion of the data residing within a non-relational data store and a second portion of the data residing within a relational data store; a query optimizer to optimize the database query to include a join operation specifying a plurality of sub-queries to join the first portion of the data and the second portion of the data into a joined data set responsive to the request; wherein the query optimizer is to further;
(i) identify a first sub-query to a table within the relational data store, corresponding to the first portion of the data for retrieval, (ii) identify a second sub-query to the non-relational data store corresponding to the second portion of the data for retrieval, (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 for retrieval and the second portion of the data for retrieval from the non-relational data store; andwherein the query optimizer to (iii) replicate the table within the relational data store to the non-relational data store comprises the query optimizer replicating the table based on a policy to replicate a smaller dataset from its primary location to a location having the larger dataset in fulfillment of the replication; and wherein the query layer agent is to execute the optimized database query against the database system to retrieve the data. - View Dependent Claims (16, 17, 18)
-
-
19. Non-transitory computer readable storage media having instructions stored thereupon that, when executed by a processor of a database system, the instructions cause the database system to optimize database queries for the database system by performing operations comprising:
-
receiving a request at a host system for the database system, the request specifying data for retrieval from the database system; retrieving, based on the request via the host system, one or more locations of the data for retrieval; generating, at the host system, a database query based on the request, wherein the database query specifies a plurality of data elements for retrieval, the plurality of data elements including a first portion of the data residing within the non- relational data store and a second portion of the data residing within the relational data store; optimizing the database query to include a join operation specifying a plurality of sub-queries to join the first portion of the data and the second portion of the data into a joined data set responsive to the request; wherein optimizing the database query further includes;
(i) identifying a first sub-query to a table within the relational data store corresponding to the first portion of the data for retrieval, (ii) identifying a second sub-query to the non-relational data store corresponding to the second portion of the data for retrieval, (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 for retrieval and the second portion of the data for retrieval from the non-relational data store;wherein optimizing the database query by (iii) replicating the table within the relational data store to the non-relational data store further comprises optimizing the database query based on a policy to replicate a smaller dataset from its primary location to a location having the larger dataset in fulfillment of the replication; and executing the optimized database query against the database system to retrieve the data.
-
Specification