12. A method comprising: in response to receiving a query, determining an execution plan that comprises a plurality of sub-plans that includes a first sub-plan and a second sub-plan; wherein the first sub-plan comprises a first operation, of a first type, that can be performed during execution of the execution plan; wherein the second sub-plan comprises a second operation, of a second type that is different than the first type, that can be performed during execution of the execution plan; wherein no sub-plan in the plurality of sub-plans contains all operations that are required to identify a valid result of the query; after determining the execution plan, executing a portion of the execution plan, wherein executing the portion of the execution plan comprises storing, in a buffer, temporary results of executing the portion; analyzing the temporary results to determine a minimum value, a maximum value, or a number of distinct values, wherein the number of distinct values is less than a number of rows in the buffer; based on the minimum value, the maximum value, or the number of distinct values, determining whether one or more criteria are satisfied; if the one or more criteria are satisfied, then executing the first sub-plan of the plurality of sub-plans without executing the second sub-plan; if the one or more criteria are not satisfied, then executing the second sub-plan of the plurality of sub-plans without executing the first sub-plan; generating a result of the query by completing execution of the execution plan and without reoptimizing the query; wherein the method is performed by one or more computing devices.
12. A method comprising: in response to receiving a query, determining an execution plan that comprises a plurality of sub-plans that includes a first sub-plan and a second sub-plan; wherein the first sub-plan comprises a first operation, of a first type, that can be performed during execution of the execution plan; wherein the second sub-plan comprises a second operation, of a second type that is different than the first type, that can be performed during execution of the execution plan; wherein no sub-plan in the plurality of sub-plans contains all operations that are required to identify a valid result of the query; after determining the execution plan, executing a portion of the execution plan, wherein executing the portion of the execution plan comprises storing, in a buffer, temporary results of executing the portion; analyzing the temporary results to determine a minimum value, a maximum value, or a number of distinct values, wherein the number of distinct values is less than a number of rows in the buffer; based on the minimum value, the maximum value, or the number of distinct values, determining whether one or more criteria are satisfied; if the one or more criteria are satisfied, then executing the first sub-plan of the plurality of sub-plans without executing the second sub-plan; if the one or more criteria are not satisfied, then executing the second sub-plan of the plurality of sub-plans without executing the first sub-plan; generating a result of the query by completing execution of the execution plan and without reoptimizing the query; wherein the method is performed by one or more computing devices. 19. The method of claim 12 , wherein: the portion of the execution plan is a first portion; the one or more criteria are one or more first criteria; the execution plan comprises a first collector that, when executed, generates first statistics related to executing the first portion of the execution plan; determining whether the one or more criteria are satisfied comprises using the first statistics to determine whether the one or more criteria are satisfied; the execution plan comprises a second collector that, when executed, generates second statistics related to executing a second portion of the execution plan that is logically after the first sub-plan and the second sub-plan; the method further comprising: using the second statistics to determine whether one or more second criteria are satisfied; if the one or more second criteria are satisfied, then executing a third sub-plan of the plurality of sub-plans without executing a fourth sub-plan of the plurality of sub-plans; if the one or more second criteria are not satisfied, then executing the fourth sub-plan of the plurality of sub-plans without executing the third sub-plan.