Query Rewrites with Views for XML in DB2

  • Authors:
  • P. Godfrey;J. Gryz;A. Hoppe;W. Ma;C. Zuzarte

  • Affiliations:
  • -;-;-;-;-

  • Venue:
  • ICDE '09 Proceedings of the 2009 IEEE International Conference on Data Engineering
  • Year:
  • 2009

Quantified Score

Hi-index 0.01

Visualization

Abstract

There is much effort to develop comprehensive support for the storage and querying of XML data in database management systems. The major developers have extended their systems to handle XML data natively. These have the advantage over stand-alone XML database systems that relational and XML data can be queried mutually. Indeed, recent SQL standards specify means to query relational and XML data together (called SQL/XML). These systems also now support XQuery, in addition to SQL. It is thus possible to mix the processing of relational and XML data via either query language. While there has been significant progress in efficient native storage systems for XML, there remain numerous challenges to handle efficiently queries over XML. There are efforts to adapt the strong optimization techniques used for relational ("SQL") queries for XML (and mixed) queries as well. One such technique, the materialized view, has been well studied, and well adopted, over the last decade as an effective technique for optimizing relational queries. Our work extends the use of materialized views for SQL/XML, and could be applied to XQuery. Within IBM DB2 9 (Viper), we implement query rewrite rules that enable the use of materialized views in the evaluation of queries over XML. % (We enable views over queries that employ XMLTable.) To accomplish this, it was necessary to extend the existing query matching and compensation framework in DB2 with new functionality. We consider what types of query rewrites based on XMLTable are possible, and which are feasible. We present a linear-time algorithm to determine the locality (self-containment) of XPath expressions within a schema-unaware environment, which we have implemented. We demonstrate the efficacy of our techniques via an experimental evaluation over a representative suite of SQL/XML queries and materialized views, executed over our DB2 prototype.