Patent ID: 7337164

Claim:
A computer-implemented method of executing a query on a data repository, the method comprising: receiving a query for execution on data in the data repository; generating an estimate of a number of results of the query in accordance with estimation functions: est ⁡ ( NOT ) = N - est ⁡ ( op ) , ⁢ est ⁡ ( AND ) = est ⁡ ( op 1 ) * est ⁡ ( op 2 ) N , and est ⁡ ( OR ) = est ⁡ ( op 1 ) + est ⁡ ( op 2 ) - est ⁡ ( op 1 ) * est ⁡ ( op 2 ) N , where op is an operand, est( ) returns an estimate of a number of results matching an operator or the operand in parenthesis, and N is the total number of possible results; defining a subset of data in the data repository; determining whether to execute the query on the subset of the data, the query to be executed on the subset of the data if the estimate of the number of results of the query indicates that executing the query on the subset of the data is estimated to return a number of results greater than a threshold number; executing the query on the subset of the data to generate a partial set of results based on the determining whether to execute the query on the subset of the data resulting in a determination to execute the query on the subset of a data; otherwise executing the query on the data repository to generate a complete set of results based on the determining; and providing the partial set of results of the execution of the query or the complete set of results of the execution of the query.