10. A computer-implemented method for executing a query, comprising: receiving a query that includes a query operator and that identifies an input data source; identifying a query category from a group of query categories for the query operator in the received query based on whether the query operator provides an output that supports random access, wherein the query categories include a first category for query operators that provide an output that supports random access, a second category for query operators that provide an output that supports random access when an input of the query operator supports random access, and a third category for query operators that provide an output that does not support random access; generating a results object based on the identified query category and based on an identification of whether the input data source supports random access to the data source or does not support random access to the data source, wherein the results object supports at least one of random access and sequential access to results produced by the query operator, and wherein the results object supports random access to results produced by the query operator by providing a first method for returning a value representing a number of elements in the results produced by the query operator, and a second method for returning an indexed element from the results produced by the query operator; and wherein the receiving, identifying, and generating are performed by at least one processor.
10. A computer-implemented method for executing a query, comprising: receiving a query that includes a query operator and that identifies an input data source; identifying a query category from a group of query categories for the query operator in the received query based on whether the query operator provides an output that supports random access, wherein the query categories include a first category for query operators that provide an output that supports random access, a second category for query operators that provide an output that supports random access when an input of the query operator supports random access, and a third category for query operators that provide an output that does not support random access; generating a results object based on the identified query category and based on an identification of whether the input data source supports random access to the data source or does not support random access to the data source, wherein the results object supports at least one of random access and sequential access to results produced by the query operator, and wherein the results object supports random access to results produced by the query operator by providing a first method for returning a value representing a number of elements in the results produced by the query operator, and a second method for returning an indexed element from the results produced by the query operator; and wherein the receiving, identifying, and generating are performed by at least one processor. 11. The method of claim 10 , wherein the results object supports sequential access to results produced by the query operator by returning an enumerator object for enumerating over the results produced by the query operator.