Join minimization in XML-to-SQL translation: an algebraic approach

Consider an XML view defined over a relational database, and a user query specified over this view. This user XML query is typically processed using the following steps: (a) our translator maps the XML query to one or more SQL queries, (b) the relational engine translates an SQL query to a relational algebra plan, (c) the relational engine executes the algebra plan and returns SQL results, and (d) our translator translates the SQL results back to XML. However, a straightforward approach produces a relational algebra plan after step (b) that is inefficient and has redundant joins. In this paper, we report on our preliminary observations with respect to how joins in such a relational algebra plan can be minimized. Our approach works on the relational algebra plan and optimizes it using novel rewrite rules that consider pairs of joins in the plan and determine whether one of them is redundant and hence can be removed. Our study shows that algebraic techniques achieve effective join minimization, and such techniques are useful and can be integrated into mainstream SQL engines.

[1]  Surajit Chaudhuri,et al.  Optimization of real conjunctive queries , 1993, PODS '93.

[2]  Z. Meral Özsoyoglu,et al.  A system for semantic query optimization , 1987, SIGMOD '87.

[3]  Ashok K. Chandra,et al.  Optimal implementation of conjunctive queries in relational data bases , 1977, STOC '77.

[4]  Hamid Pirahesh,et al.  Complex query decorrelation , 1996, Proceedings of the Twelfth International Conference on Data Engineering.

[5]  Guy M. Lohman,et al.  Query Optimization in the IBM DB2 Family. , 1993 .

[6]  Alfred V. Aho,et al.  Efficient optimization of a class of relational expressions , 1979, TODS.

[7]  Dan Suciu,et al.  On database theory and XML , 2001, SGMD.

[8]  Dongwon Lee,et al.  NeT & CoT: translating relational schemas to XML schemas using semantic constraints , 2002, CIKM '02.

[9]  Eugene J. Shekita,et al.  Querying XML Views of Relational Data , 2001, VLDB.

[10]  Raghu Ramakrishnan,et al.  Containment of conjunctive queries: beyond relations as sets , 1995, TODS.

[11]  Alin Deutsch,et al.  Physical Data Independence, Constraints, and Optimization with Universal Plans , 1999, VLDB.

[12]  Hamid Pirahesh,et al.  Extensible/rule based query rewrite optimization in Starburst , 1992, SIGMOD '92.

[13]  Dan Suciu,et al.  SilkRoute: A framework for publishing relational data in XML , 2002, TODS.

[14]  David S. Johnson,et al.  Testing containment of conjunctive queries under functional and inclusion dependencies , 1982, J. Comput. Syst. Sci..

[15]  Jeffrey F. Naughton,et al.  Efficient XML-to-SQL Query Translation: Where to Add the Intelligence? , 2004, VLDB.

[16]  Hamid Pirahesh,et al.  A rule engine for query transformation in Starburst and IBM DB2 C/S DBMS , 1997, Proceedings 13th International Conference on Data Engineering.