摘要:
Database system and methods are described for improving execution speed of database queries (e.g., for decision support) by optimizing execution of nested queries or “subqueries,” which are commonly used in client/server database environments. In particular, the basic approach employed is to recognize the part of the subquery that is not related to the outer references and cache the result of that part after its first execution. Later, the result can be reused and combined with the result of the rest of the subquery that is changing for each iteration. Methods are employed to recognize the invariant part of a data flow tree, and to restructure the evaluation plan to reuse the stored intermediate result. An efficient method is used to teach an existing join optimizer to understand the invariant feature and thus allow it to be able to generate better join plans in the new context. When query rewriting is not possible, therefore, the invariant technique provides significantly better performance than the traditional nested iteration method.