Deferred XPath Evaluation in Binary XML Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Optimizing queries on views that provide abstraction over XML documents in database systems is challenging due to the potential adverse effects of transformation order on query execution performance, particularly when XML re-writing occurs before view merge, leading to unnecessary expression evaluation and reduced optimization opportunities.

Innovation Solution

The query optimizer determines the relative order of query transformations, considering the availability of a XML index to defer XML re-writing until after the view merge stage, ensuring that only necessary XPath expressions are evaluated and optimized, thereby improving query execution efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If XML re-writing is performed before view merge, then XPath expressions are transformed early, but unnecessary expressions are evaluated and optimization opportunities are reduced

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidcomputational waste
Core Design Contradiction:
ProductivityVSLoss of energy

Solution Approach 1:

The query optimizer performs preliminary analysis of the query plan to identify which XPath expressions are actually needed before executing the view merge. By determining the necessary expressions in advance, the system avoids unnecessary XML re-writing operations and computational waste while maintaining optimization opportunities.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system dynamically adjusts the order of query transformations based on the specific query structure and available XML indexes. The query optimizer flexibly switches between different transformation sequences (XML re-writing before or after view merge) depending on what produces the most efficient execution plan, rather than following a fixed order.

Inventive Principle:
Principle #15Dynamics

2Productivity

If XML re-writing is performed before view merge, then transformations are applied early, but view merge optimization opportunities are reduced

Engineering Contradiction:
Improvequery execution efficiencyVSAvoidoptimization complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The query optimizer performs preliminary analysis to determine which XPath expressions are needed before executing view merge. This preliminary determination allows the system to maintain full optimization opportunities while avoiding unnecessary transformations, effectively managing complexity by being selective about when transformations are applied.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system changes the parameter of transformation timing based on query characteristics. By adjusting whether XML re-writing occurs before or after view merge, and by controlling which expressions are rewritten, the system optimizes the balance between transformation benefits and optimization opportunities.

Inventive Principle:
Principle #35Parameter changes

3Reliability

If all XPath expressions are evaluated, then complete data is processed, but unnecessary expressions consume resources

Engineering Contradiction:
Improvedata completenessVSAvoidenergy consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The query optimizer extracts and identifies only the necessary XPath expressions that are actually needed for the query result. By taking out the unnecessary expressions from the evaluation process, the system maintains data completeness for required fields while eliminating resource consumption on unnecessary computations.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

Instead of evaluating all XPath expressions completely, the system performs partial evaluation only on the subset of expressions that are actually needed. This partial action approach ensures sufficient data processing for the query requirements while avoiding the excessive energy consumption that would result from evaluating all expressions.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS8073843B2Mechanism for deferred rewrite of multiple XPath evaluations over binary XML
Publication Date: 2011.12.06 ORACLE INT CORP
  • US8073843B2 patent drawing
  • US8073843B2 patent drawing
  • US8073843B2 patent drawing

AI summary

A mechanism is provided for improving the performance of particular database queries operating on a view comprising binary-encoded XML. A determination is made about whether a XML index is available to improve the computation of XPath data before deriving an optimized execution plan for a particular query. When a XML index is not available to help expedite the computation of binary-encoded XML, then deferring the computation of the XPath data until after the view merge stage avoids unnecessary computation of XPaths that are part of the view but not needed for the particular query.