Patent ID: 8244714

Claim:
A method of incrementally preparing a report that requires a join, the method including: an on-demand database service receiving a request from a tenant for a report on database tables in memory that requires performing a join between the database tables; determining a depth-first-search query sequence to implement the join that includes at least first and second queries; retrieving an initial chunk of objects responsive to the first query and using foreign keys in the initial chunk of objects to perform the second query, wherein a size of the initial chunk is selected to at least fill a view window and to limit how many objects are retrieved responsive to the first and second queries; compiling initial results of the first and second queries and generating an initial view of the report requested from the compiled initial results; and one or more times, receiving a request for further results for the report, retrieving a further chunk of objects responsive to the first query, using foreign keys in the further chunk to perform the second query, compiling further results of the first and second queries, and generating a further view of the report from the compiled further results.