XML Query Rewriting for Database Text Search Efficiency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing technologies do not efficiently integrate full-text searching of XML documents stored in databases using XML expressions, leading to inefficient processing and lack of optimization opportunities.
Innovation Solution
The transformation of database commands containing embedded XML expressions into full-text functions, allowing for efficient retrieval of XML documents by rewriting XML query language expressions into database query language expressions, utilizing cost-based or rule-based analysis to determine the best transformation approach.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If the DBMS converts data to XML form and sends to XPath operation process, then XML documents can be retrieved using XML query language, but unnecessary XML element generation occurs reducing efficiency
Solution Approach 1:
The patent extracts only the necessary data from database columns that affect the search results, rather than converting entire XML documents. This is achieved by analyzing the XPath expression to identify relevant columns, then extracting only data from those columns for the search operation.
Solution Approach 2:
Instead of converting database data to XML form and then searching, the patent inverts the approach by rewriting the XPath-based XML query as a native SQL query that operates directly on the relational database structure, eliminating the need for XML conversion entirely.
2Ease of operation
If XPath operation parses converted data to identify information, then XML expressions can be evaluated, but full data conversion occurs even when only portions are needed
Solution Approach 1:
The patent extracts only the relevant columns identified from the XPath expression analysis. The system determines which database columns correspond to elements in the XPath path and extracts data only from those columns, avoiding conversion and processing of unrelated data.
Solution Approach 2:
The patent performs preliminary analysis of the XPath expression to identify relevant columns before executing the search. This pre-processing step allows the system to prepare an optimized SQL query that targets only the necessary data, avoiding unnecessary conversion and processing.
3Adaptability or versatility
If SQL/XML query uses XPath operations on XML type objects, then XML document retrieval is enabled, but query rewriting opportunities are lost
Solution Approach 1:
The patent inverts the traditional approach by rewriting XPath-based XML queries as native SQL queries. Instead of evaluating XPath expressions on XML data, the system translates the XPath logic into equivalent SQL operations that leverage the database's native query optimization capabilities.
Solution Approach 2:
The patent replaces the XPath operation mechanism with a SQL query mechanism. By substituting the XML-based query evaluation system with a relational SQL system, the patent enables the use of database optimization techniques, indexes, and execution plans that are specific to SQL operations.
Data Source
AI summary
A method and apparatus for rewriting a database command containing an embedded XML expression such that the rewritten database command recites a text function, in lieu of the embedded XML expression, is provided. Advantageously, a DBMS may take advantage of the efficiencies in storing XML data within the database, while avoiding the generation of unnecessary XML elements in processing the query when the XML elements contribute nothing to the outcome of the query. Cost-base or rule-based analysis may be performed to determine how to rewrite a received database command. The database server may functionally evaluate the text function or may use an index defined on a column of the database. The text function may function as a primary filter or may reference a column upon which an index is defined, wherein the index operates at the same or higher level than a column being referenced in the embedded XML expression.


