Patent ID: 8688647

Claim:
A computer program product embodied on a non-transitory computer readable medium, comprising: computer code for identifying an entity implemented within a multi-tenant on-demand database system, where the entity includes a tenant of the system; computer code for determining one or more indexes associated with the entity; and computer code for calculating a size of the entity including an amount of storage consumed by the entity by: selecting a sample clause representing a portion of the one or more indexes associated with the entity; dynamically generating structured query language (SQL) instructions for all columns of each index within the sample clause to determine a sample size of data in bytes within the columns of the sample clause, where the SQL instructions utilize a vsize function for all columns of each index within the sample clause to determine a size of data in bytes within the columns of the sample clause; and estimating, using the sample size, a total size of data within all of the indexes associated with the entity.