Patent ID: 8352945

Claim:
A computer program product comprising a non-transitory computer useable storage medium to store a computer readable program, wherein the computer readable program, when executed on a computer, causes the computer to perform operations comprising: receiving a plurality of queries; storing a block of data in a first cache associated with a first processor core, the block of data comprising a subset of data stored in an in-memory database (IMDB); running a query of the plurality of queries over a sample of the data stored in the IMDB; determining that the query may be placed in a batch with other queries in response to determining that a number of tuples that pass a selection predicate of the query is below a threshold; monitoring a number of distinct groups encountered by running the query; estimating a working set size for the query as the number of distinct groups encountered in response to determining that the cumulative size of the distinct groups encountered is less than or equal to the size of the first cache minus the size of the block of data; batching the queries based, at least in part, on the estimated working set size; scanning the block of data in the first cache against a first batch of queries on the first processor core, the first batch of queries comprising two or more of the queries; and scanning the block of data against a second batch of queries on a second processor core, the second batch of queries comprising one or more of the queries exclusive of the queries included in the first batch of queries.