Minimization and group-by detection for nested XQueries
Alin Deutsch, Yannis Papakonstantinou, Yu Xu · 2004
We extend tree pattern queries into group-by normal form tree pattern (GNFTP) queries, which are nested, perform arbitrary joins, and freely mix bag and set semantics. Here, we describe a subset of XQuery, called OptXQuery and provide a normalization algorithm that rewrites any OptXQuery into a GNFTP query. Key logical query optimizations can be solved for GNFTP/OptXQuery. As a proof-of-concept but also for its own importance and value in query optimization, we developed and evaluated a query minimization algorithm for GNFTP. The rich features of GN-FTP/OptXQuery create key challenges that fundamentally extend the prior work on the problems of minimizing conjunctive queries. An important application of this technique is group-by detection. We extend GNFTP into extGNFTP to capture XQueries outside the OptXQuery set. The extGNFTP notation provides the logical plan optimization framework of our XQuery processor.