Unit-testing query transformation rules

  • Authors:
  • Mostafa Elhemali;Leo Giakoumakis

  • Affiliations:
  • Microsoft SQL Server, Microsoft Corp., Redmond, WA;Microsoft SQL Server, Microsoft Corp., Redmond, WA

  • Venue:
  • Proceedings of the 1st international workshop on Testing database systems
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

The process of validating the internal functionality of a query optimizer includes the selection of appropriate queries to be used as test cases for exercising and validating specific code paths. Specifically, it is desirable to be able to implement unit-tests for small components of the query optimizer such as the query transformation rules. In this paper, we present a practical method that simplifies the creation of test cases for validating query transformation rules in a query optimizer. We present the QRel programming framework, which allows designing test cases based on relational algebra expressions. We show how such a framework can be used to create classes of similar test cases that exercise transformation rules over a variety of relational algebra expressions. Finally, we provide some examples of how QRel is used to validate SQL Server's optimizations for subqueries.