Validating multiple groups dating with brooks dun
Execution plans for a given query are seldom unique.
That is, there is usually a number—frequently a very large number—of different execution plans, each having different operations and/or different orders of operations, that all generate the same set of result data. Some have a lower—sometimes very much lower—execution cost than others.
If desired, alternatives can be specified for producing only certain plans, for covering a particular range of plans, or for other purposes. 1 is a high-level block diagram of an illustrative computer system serving as an environment for the invention. 2 is a block diagram of a portion of a database system relevant to the invention. 3 is a symbolic representation of a data structure for holding multiple execution plans according to the invention. 4 shows a sample execution plan selected from the representation of FIG. This description and the accompanying drawing illustrate specific examples of embodiments in which the present invention can be practiced, in sufficient detail to allow those skilled in the art to understand and practice the invention.
The execution trees are then tested, analyzed, or otherwise manipulated. 5 is a flowchart of a ranking function according to the invention. 6 is a flowchart of an unranking function according to the invention.
Where time is available for a test of every plan, the invention can provide an exhaustive list of all possible alternative plans for a given query.