Advantages of pureXML in Databases

Source: Internet
Author: User
Tags xquery

In relational databases, the first generation of XML supports splitting or splitting) documents to adapt to Relational Tables or store documents as characters or binary large objects CLOB or BLOB ). Either of the two methods tries to forcibly convert the XML model into a relational model. However, these two methods have great functional and performance limitations. The hybrid model stores XML in a model similar to DOM. XML data is formatted as a buffered data page for quick navigation and query and simplified indexing.

PureXML has significant advantages in the following fields:

Storage: The pureXML technology will store XML at the node level rather than the document level. In databases, the primary storage unit of the physical storage layer is a node. Each page has one node, while other nodes come from the same or different documents. Each node not only links its parent node, but also its subnodes.

Therefore, the efficiency of browsing a node's parent, peer, or subitem is very high, as long as the next referenced node is on the same page, the traversal speed is faster than the pointer traversal speed. You do not need to overwrite the entire document to increase or decrease nodes, or redeploy nodes to other pages.

Indexing: XML applications that manage millions of XML documents are not uncommon. Therefore, to provide high query performance, you must index a large amount of XML data. DB2 supports creating path-specific indexes on XML columns. Therefore, elements and attributes are often used as predicates and cross-document join indexes can be compiled.

The new XML value index can effectively evaluate XML Schema expressions to improve the query performance of XML documents. Compared with traditional relational indexes, in relational indexes, the index key consists of one or more table columns specified by the user, while the XML value index uses a specific subset of the XML schema expression XPath, XPath does not contain predicates, etc.) to compile the index of values in paths and XML documents stored in an XML column. If the value is not specified in the document, the index can also fill in the default attribute and element value in the mode during insertion.

When creating an index, you can specify the index path and index type. You can compile the index of any node that matches the path expression and path expression set in the XML document stored in this column, in addition, the index can direct to the node in the storage and be connected to its parent node and subnode for quick browsing ). The index entry does not provide an index at the beginning of the document, but contains the location information of the actual document node. Therefore, this index can quickly access the nodes in the document and avoid document traversal.

Query: XQuery is a new language used to query XML data. It is used to process different modes, such as sequences rather than SQL sets), multi-nested sequences, and sparse attributes. XQuery also supports different modes and dynamic structure changes.

IBM implementation does not contain independent XQuery or XPath processing programs. Basic XQuery and XPath are directly embedded in the query engine. The query compiler is bilingual and comes with two interoperable Query Language resolution programs-one for SQL and the other for XQuery-to generate a query chart model for processing relational and XML data). Because the intermediate query expression is a neutral language, the combination of XQuery, SQL, and XQuery and SQL will be compiled into the same intermediate expression, after the same rewriting and conversion, optimize and generate similar executable code in a similar way. No matter which language is used to specify the query design, this process will produce the optimal interoperability query design.

Because the two parsing programs can operate on each other, you can mix SQL and XQuery in the same statement to make the search more powerful: query in the XML document and return its fragments from the SQL statement.

  1. DB2 Version 9.5 pureXML enhancements and new features
  2. Database Table Structure Extension Based on pureXML Technology
  3. Generate a Web Service for DB2 9 pureXML

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.