A method for predictable query execution through early materialization is
provided. The method deals with the problem of cardinality misestimation
in query execution plans, by pre-executing sub-plans on a query execution
plan that have questionable estimates and collecting statistics on the
output of these sub-plans. If needed, the overall query execution plan is
changed in light of these statistics, before optimizing and executing the
remainder of the query.