# US 8,280,875 B2 · Method, system, and computer program product for optimizing a database query

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,280,875 B2
- Document ID: US8280875B2
- Status: Granted
- Kind: B2
- Application number: 12/776,293
- Filed: 2010-05-07
- Published: 2010-08-26
- Granted: 2012-10-02
- Earliest claimed: 2003-09-23
- Assignees: salesforce.com, inc.
- Inventors: Craig Weissman; Dave Moellenhoff; Simon Wong; Paul Nakada
- Web page: https://patentgrep.com/patent/US8280875B2

## CPC

- G06F 21/6218: {to a system of files or objects, e.g. local or distributed file system or database}
- G06F 16/2453: Query optimisation
- G06F 16/2462: {Approximate or statistical queries}
- Y10S 707/99932: Access augmentation or optimizing
- Y10S 707/99933: Query processing, i.e. searching
- Y10S 707/99934: Query formulation, input preparation, or translation
- Y10S 707/99935: Query augmenting and refining, e.g. inexact access
- Y10S 707/99938: Concurrency, e.g. lock management in shared database
- Y10S 707/99939: Privileged access
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y10S: TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS

## Abstract

More efficient querying of a multi-tenant database using dynamic tuning of database indices. A layer of meta-data associates data items with tenants, e.g., via tags, and the meta-data is used to optimize searches by channeling processing resources during a query to only those pieces of data bearing the relevant tenant's unique tag.

## Claims

### Claim 1

A method of optimizing database queries in a multi-tenant database, the database having one or more data tables, each table having one or more logical columns defining data categories and one or more logical rows associated with a plurality of tenants, the method comprising:
generating tenant-level statistics from data stored in each of the data tables, the data stored in the data tables comprising tenant specific data, and the data tables being stored in one database;
receiving a database query; and
optimizing the database query based on the tenant-level statistics.

### Claim 2 (depends on 1)

The method of claim 1, wherein the plurality of tenants provide the tenant-specific data in one or more custom fields specific to each of the plurality of tenants.

### Claim 3 (depends on 2)

The method of claim 2, wherein the tenant-specific data provided by the plurality of tenants is stored in at least one table that includes only data from one of the plurality of tenants.

### Claim 4 (depends on 2)

The method of claim 2 wherein the tenant-level statistics are stored in a separate table using at least one customizable field and wherein the at least one customizable field is indexable.

### Claim 5 (depends on 1)

The method of claim 1 further comprising implementing at least one security mechanism to keep the tenant-specific data separate unless the data is shared.

### Claim 6 (depends on 5)

The method of claim 5, wherein the at least one security mechanism includes filtering the tenant-specific data based on an access level of the tenant.

### Claim 7 (depends on 5)

The method of claim 5, wherein the at least one security mechanism includes encryption.

### Claim 8

A system of optimizing database queries in a multi-tenant database system comprising:
a memory coupled to a processor;
a database having one or more data tables, each table having one or more logical columns defining data categories and one or more logical rows associated with a plurality of tenants;
logic for generating tenant-level statistics from data stored in each of the data tables, the data stored in the data tables comprising tenant-specific data and the data tables being stored in one database;
logic for receiving a database query; and
logic for optimizing the database query based on the tenant-level statistics.

### Claim 9 (depends on 8)

The system of claim 8, wherein the system is operable such that the plurality of tenants provide the tenant-specific data in one or more custom fields that are specific to each of the plurality of tenants.

### Claim 10 (depends on 9)

The system of claim 9, wherein the system is operable such that the tenant-specific data provided by the plurality of tenants is stored in at least one table that includes only data from one of the plurality of tenants.

### Claim 11 (depends on 9)

The system of claim 9, wherein the system is operable such that the tenant-level statistics are stored in a separate table using at least one customizable field and wherein the system is operable such that the at least one customizable field is indexable.

### Claim 12 (depends on 8)

The system of claim 8, further comprising logic for implementing at least one security mechanism to keep the tenant specific data separate unless the data is shared.

### Claim 13 (depends on 12)

The system of claim 12, wherein the system is operable such that the at least one security mechanism includes filtering the tenant-specific data based on an access level of the tenant.

### Claim 14 (depends on 12)

The system of claim 12, wherein the system is operable such that the at least one security mechanism includes encryption.

### Claim 15

A computer program product embodied on a non-transitory storage medium of optimizing database queries in a multi-tenant database system, the database having one or more data tables, each table having one or more logical columns defining data categories and one or more logical rows associated with a plurality of tenants, the computer program product comprising:
computer code for generating tenant-level statistics from data stored in each of the data tables, the data stored in the data tables comprising tenant-specific data, and the data tables being stored in one database;
computer code for receiving a database query; and
computer code for optimizing the database query based on the tenant-level statistics.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the computer program product is operable such that the plurality of tenants provide the tenant-specific data in one or more custom fields that are specific to each of the plurality of tenants.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the computer program product is operable such that the tenant-specific data provided by the plurality of tenants is stored in at least one table that includes only data from one of the plurality of tenants.

### Claim 18 (depends on 16)

The computer program product of claim 16 wherein the computer program product is operable such that the tenant-level statistics are stored in a separate table using at least one customizable field and wherein the computer program product is operable such that the at least one customizable field is indexable.

### Claim 19 (depends on 15)

The computer program product of claim 15 further comprising computer code for implementing at least one security mechanism to keep the tenant-specific data separate unless the data is shared.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein the computer program product is operable such that the at least one security mechanism includes filtering the tenant-specific data based on an access level of the tenant.

### Claim 21 (depends on 19)

The computer program product of claim 19, wherein the computer program product is operable such that the at least one security mechanism includes encryption.
