Testing an SQL database system by running large sets of deterministic or stochastic SQL statements is common practice in commercial database development. However, code defects often remain undetected as the query optimizer's choice of an execution plan is not only depending on the query but strongly influenced by a large number of parameters describing the database and the hardware environment. Modifying these parameters in order to steer the optimizer to select other plans is difficult since this means anticipating often complex search strategies implemented in the optimizer. In this paper we devise algorithms for counting, exhaustive generation, and uniform sampling of plans from the complete search space. Our techniques allow extensive validation of both generation of alternatives, and execution algorithms with plans other than the optimized one-if two candidate plans fail to produce the same results, then either the optimizer considered an invalid plan, or the execution code is faulty. When the space of alternatives becomes too large for exhaustive testing, which can occur even with a handful of joins, uniform random sampling provides a mechanism for unbiased testing. The technique is implemented in Microsoft's SQL Server, where it is an integral part of the validation and testing process.
CITATION STYLE
Waas, F., & Galindo-Legaria, C. (2000). Counting, Enumerating, and Sampling of Execution Plans in a Cost-Based Query Optimizer. In SIGMOD 2000 - Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data (pp. 499–509). Association for Computing Machinery, Inc. https://doi.org/10.1145/342009.335451
Mendeley helps you to discover research relevant for your work.