Methods and apparatus, including computer systems and program products,
for executing a query on a subset of data, for example, to facilitate a
fast search with a very large result set. In one general aspect, a method
of executing a query includes receiving a query for execution on data in
the data repository; generating an estimate of a number of results of the
query; defining a subset of data in the data repository; determining
whether to execute the query on the subset of the data; executing the
query on the subset of the data to generate a partial set of results if
the query is to be executed on the subset of the data, otherwise
executing the query on the data repository to generate a complete set of
results; and providing query results.