XML Query Path Expansion with Schema Order Validation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
XML query rewriting techniques fail to preserve the order of nodes when expanding path expressions containing wildcards, descendant axes, or OR operators, leading to invalid optimizations that harm the order of returned nodes.
Innovation Solution
A database server determines whether path expansion is valid by analyzing the context and content model of the XML schema, ensuring that the order of targeted XML data can be guaranteed, and only expanding paths if the order is preserved, thereby rewriting the query to maintain the original node order.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If path expansion is performed on XML queries containing wildcards, descendant axes, or OR operators, then query optimization is improved, but the order of returned nodes is not preserved
Solution Approach 1:
The system performs preliminary analysis of the XML schema content model before executing path expansion. It determines in advance whether the schema guarantees a specific order of child nodes for the elements targeted by the path expression. Only if this preliminary check confirms order preservation does the system proceed with path expansion, thus avoiding post-processing corrections and ensuring both optimization and order preservation.
2Manufacturing precision
If path expansion is avoided to preserve node order, then node order is maintained, but query performance degradation occurs due to costly functional evaluations
Solution Approach 1:
The system performs a preliminary check of the XML schema content model to determine whether child nodes of the targeted elements are guaranteed to appear in a specific order. This advance analysis allows the system to confidently perform path expansion when order preservation is guaranteed by the schema, eliminating the need for costly functional evaluations while maintaining node order.
3Productivity
If XML queries are rewritten without schema validation, then query execution speed is improved, but invalid optimizations occur that harm node order
Solution Approach 1:
The system performs preliminary validation against the XML schema content model before rewriting queries with path expansion. By checking whether the schema guarantees a specific order of child nodes in advance, the system ensures that optimizations are only applied when they are valid and will not harm node order, thus maintaining both execution speed and optimization validity.
Data Source
AI summary
Techniques for determining whether an XML query may be written are provided. In one scenario, an XML query includes an expandable path, which is a path expression that includes a wildcard character (*) or a descendant axis (//). An XML schema is used to generate multiple expanded paths (each of which is a simple path expression) from the expandable path. The XML schema is used to compare each expanded path to another expanded path and to determine whether the nodes identified by the respective expanded paths are guaranteed to occur in a particular order in XML documents that conform to the XML schema. In another scenario, an XML query includes an order operator that takes two paths as input. Similarly, an XML schema is used to compare the two paths and to determine whether the nodes identified by the two paths are guaranteed to occur in a particular order in XML documents that conform to the XML schema.


