Statistics management for database querying
Assigneesalesforce.com, inc.
InventorsChirag Rajan, Jesse Collins, Seung-Yeoul Yang, Hoon Kim
Life of this patent
Estimating the term…
Abstract
Methods and systems are provided for querying a database. One exemplary method for obtaining data from an on-demand database supporting one or more tenants involves obtaining model database statistics based on expected utilization information for a tenant and providing the model database statistics to the on-demand database. The on-demand database utilizes the model database statistics to generate a query plan and executes the query plan to obtain data from the model database statistics.
Claims20
A method of obtaining data from a multi-tenant database, the method comprising:
- modifying a development database representative of the multi-tenant database based on expected utilization information for a tenant supported by the multi-tenant database;
- generating model database statistics based on the development database after modifying the development database, wherein generating the model database statistics comprises:
- obtaining a subset of database statistics determined by a database management system of the development database after modifying the development database;
- creating the model database statistics having values representative of an anticipated state of the multi-tenant database based at least in part on the obtained subset of the database statistics determined by the database management system of the development database;
- and
- providing the model database statistics to the multi-tenant database by modifying on-demand database statistics maintained by the multi-tenant database to reflect the model database statistics, a query optimizer of the multi-tenant database generating a query plan based on the on-demand database statistics, wherein the query plan generated by the multi-tenant database to obtain the data is influenced by the model database statistics.
A method of querying an on-demand database in a multi-tenant system including an application server providing instances of a virtual application over a network to a plurality of tenants, the method comprising:
- instantiating a development database representative of the on-demand database;
- obtaining expected utilization information for the on-demand database from one or more tenants of the plurality of tenants;
- modifying the development database based on the expected utilization information;
- generating model database statistics based on the development database after modifying the development database, wherein generating the model database statistics comprises:
- obtaining a subset of database statistics determined by a database management system of the development database after modifying the development database;
- creating the model database statistics having values representative of an anticipated state of the on-demand database based at least in part on the obtained subset of database statistics determined by the database management system of the development database;
- obtaining, by the application server, the model database statistics;
- modifying, by the application server, on-demand database statistics maintained by the on-demand database to reflect the model database statistics, resulting in updated database statistics maintained by the on-demand database;
- and
- providing, by the application server, a query statement to the on-demand database, wherein a query optimizer of the on-demand database determines a query plan based on the query statement and the updated database statistics.
A computing system comprising a processor and a memory, wherein the memory comprises computer-executable instructions that, when executed by the processor, cause the computing system to:
- obtain model database statistics for an on-demand database from a development database modified based on expected utilization information for one or more tenants having data maintained in the on-demand database, the model database statistics being created based at least in part on an obtained subset of database statistics determined by a database management system of the development database after the development database is modified, the model database statistics having values representative of an anticipated state of the on-demand database;
- update on-demand database statistics maintained by the on-demand database to reflect the model database statistics;
- and
- provide a query statement to the on-demand database, wherein a query optimizer of the on-demand database determines a query plan based on the updated on-demand database statistics and the query statement.
Dependencies are inferred from the claim text.