11. The computer system recited in claim 9 , wherein the processor is configured to: generate a heuristic query plan for the query; enumerate a heuristic query plan from a multijoin to generate a first plurality of substitutes for the multijoin; assign a potential to each of the first plurality of substitutes, wherein the potential represents a ranking based on a likelihood of producing a low cost query plan; and generate a query plan based on the assigned potential, the potential threshold, and the first plurality of substitutes.
11. The computer system recited in claim 9 , wherein the processor is configured to: generate a heuristic query plan for the query; enumerate a heuristic query plan from a multijoin to generate a first plurality of substitutes for the multijoin; assign a potential to each of the first plurality of substitutes, wherein the potential represents a ranking based on a likelihood of producing a low cost query plan; and generate a query plan based on the assigned potential, the potential threshold, and the first plurality of substitutes. 12. The computer system recited in claim 11 , wherein the potential is assigned by the processor being configured to: determine a dataflow for each of the first plurality of substitutes; rank the first plurality of substitutes in ascending order of the dataflow; and determine the potential based on the ranking.