search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Home Backend Development XML/RSS Tutorial XML data query technology has become a hot research topic nowadays.

XML data query technology has become a hot research topic nowadays.

Feb 13, 2017 pm 03:49 PM

xml (Extensible Markup Language) has become the standard for data representation and data exchange in Web applications. With the rapid development of the Internet, especially the widespread use of e-commerce, Web services and other applications, XML type data has become the current mainstream data form. Therefore, XML data management technology, especially XML data query technology, has become a current research hotspot.


#Compared with relational data, XML has various advantages, but its biggest drawback is its efficiency. Because in a relational data file, the field name of the data only needs to appear once, but in the XML data file, the element name will appear repeatedly, which will definitely affect the efficiency of the query. In order to improve the query efficiency of XML as much as possible, it is necessary to provide indexing function for XML type.


The World Wide Web Consortium identified XPath 2.0 and XQuery 1.0 as recommended standards on January 23, 2007, ending the previous competition among various query languages. Based on this standard, in addition to traditional manufacturers, various scientific research institutions have proposed implementations of XPath and XQuery (there are more than a dozen mentioned in the literature), with different storage models, different query algorithms, and optimization methods. , in this context, Dameng Database Company also proposed its own XML query engine model based on its own development strategy. Currently, Dameng's XML query engine is under intense development, and establishing effective indexes for XML data is an important factor affecting XML. An important factor in data query performance. Based on an in-depth analysis of the indexing technology of existing database products, a more reasonable index structure is designed for the Dameng XML query engine so that the engine can achieve optimal performance.


Introduction to XML indexing technology


Currently, people’s research on XML is mainly divided into two aspects. One is a native database for the storage, query and management of semi-structured data such as XML. The data and metadata are completely expressed in XML structures and have nothing to do with its underlying data storage format (such as object model, relational model, etc.). The other is the mutual conversion between it and the relational database, using the mature technology of the relational database to process XML data. Since the latter direction has more practical significance, it has become the focus of XML research.


#In addition to storage solutions, index technology is also one of the most important factors in determining a database system. If no index structure is built for XML documents, then any query for XML data is likely to result in traversing the entire document tree. As the XML data set increases, this overhead is intolerable. Therefore, the research on XML index technology has high theoretical and practical value.


Although traditional indexing technology has been relatively mature after long-term accumulation, this type of indexing technology is mainly based on values ​​(rather than patterns with certain relationships) The function of locating data records does not pay much attention to the logical relationship between data records; the basic feature of XML data query is to extract data that conforms to the pattern based on the input of pattern features (structural relationships described in the form of regular path expressions). Therefore, XML The main content of indexing is to design techniques suitable for pattern matching.


XML index classification


Path-based XML index


The path-based index is based on the path information of the node in the XML tree structure, and adopts a certain reduction method so that the reduced tree structure only maintains different path information, and there will not be two files with the same path. nodes. Such indexes that have been proposed include: DataGuides index, Index Fabric index, Adaptive Path Index for XML Data (APEX)


Dataguides index is A structural summary of the refined path starting from the root node. The string paths formed by concatenating edge labels are described only once in Dataguides. Dataguides reduce the number of nodes required when traversing path queries, and are efficient at traversing XML documents from the root. However, path queries containing wildcard characters or path queries with the descendant-or-self axis defined in the XPath standard require multiple connection operations, resulting in low query efficiency and data redundancy.


Then write the java object file TestLob.java about these two large fields, and define the type as CLOB and BLOB attribute fields as String and byte[] types respectively. Since CLOB handles large text types, so it corresponds to the String type in Java. BLOB handles some large files that are not strictly defined and are stored in a binary stream format, so let it use the byte[] type, and then define the Getters of these two attributes respectively. and Setter method, the relevant code is as follows:


Dataguides index is a structural summary of the refined path starting from the root node. The string paths formed by concatenating edge labels are described only once in Dataguides. Dataguides reduce the number of nodes required when traversing path queries, and are efficient at traversing XML documents from the root. However, path queries containing wildcard characters or path queries with the descendant-or-self axis defined in the XPath standard require multiple connection operations, resulting in low query efficiency and data redundancy.


Index Fabric is an index structure developed on the Patricia Trie tree. It encodes each marked path to each element node with a string, and then inserts these encoded values ​​into the Patricia Trie tree. Go, thus converting the query of XML data according to the path into the query of string. When querying, first encode the query path into a string form, and then search it in the index tree. The advantage of Index Fabric index is that it stores the hierarchical structure information of XML data, uniformly handles the retrieval of XML data with schema and schema-less information, and makes the time required for querying and updating XML data related to the hierarchy rather than to the The length of the index key is related. The disadvantage of Index Fabric index is that it loses the structural relationship between element nodes, because it only retains the information of element nodes with text values. Therefore, similar to DataGuides indexes, Index Fabric indexes are not efficient at handling partial match query expressions with descendant-or-self axes defined in the XPath standard


#For this reason , APEX [14] introduces information that depends on the distribution of XML data queries: label nodes corresponding to frequently occurring XML query statements are saved in a hash structure in advance. Its function is similar to the function of Cache: when a new query requires processing, it first searches the hash table to see if there is a satisfying node set. But it is less efficient for query expressions with element values ​​or attribute values.


Node-based index


Node-based index essentially decomposes XML data into data units Record collection, and save the location information of the unit in the XML data in the record. Unlike path-based indexes, node-based indexes break the restriction that nodes must be found through label paths and decompose XML data into node records in a canonical form. Because it saves the location information of nodes and can be well integrated into mature relational database management systems, it is currently the most widely used index.


According to different encoding methods of location information, node-based indexes can generally be divided into the following categories:


1. Prefix-based index


The prefix-based index is mainly an index generated based on Dewey[12] encoding. The ORDPATH encoding in document [13] also uses a similar method, and gives a method of compressing ORDPATH, which has been applied to the index organization of SQL Server 2005.



The basic idea of ​​prefix encoding is to directly use the encoding of a node's parent node as the prefix of the node encoding. For prefix encoding, To determine whether a node v is a descendant of another node u, just determine whether the code of u is the prefix of the code of v. An important property of prefix coding indexes is their dictionary ordering: for any node u in the subtree rooted at node r, its prefix coding c(u) is greater (less than) its left sibling subtree (right sibling subtree) ) The prefix encoding of all nodes in . Therefore, prefix-based indexes can not only effectively support the calculation of inclusion relationships, but also effectively support the calculation of document position relationships.


2. Index based on interval coding


For interval coding index, each node in the tree T is given an interval code [begin, end], which satisfies: the interval code of a node includes the interval code of its descendant nodes. In other words, node u in tree T is the ancestor of node v if and only if start (u)


The first interval coding scheme is Dietz coding. Each node in the tree T is assigned a pre-order traversal sequence number and a post-order traversal sequence number. Tuple. Since an ancestor node u in the tree T must appear before (after) its descendant node v in the pre-order traversal (post-order traversal), therefore, the nodes u and v are ancestor/descendant relationships, If and only if PRe(u)


Another typical example of interval-encoded index is the XISS index, which assigns each node a number pair, where order is extended Preorder encoding, size is the range of descendants of the node. For any node X and Y in a document tree, if and only if order(x)


XISS index decomposes the original query statement into subexpressions. Then implement the query for these sub-expressions respectively, and finally join these intermediate results to obtain the query result set. This can better support query statements containing wildcard characters. However, it obtains the final query result after concatenating each intermediate result. Although such a method can indeed solve all wildcard problems, the concatenation of such intermediate results is likely to be very time-consuming, especially for simple expressions with long paths.


Comparison of two indexing mechanisms


The path-based index is mainly based on the node merging strategy, through nodes, etc. Using techniques such as valency and path equivalence, we can obtain an index structure that is much smaller than the original document. Its structure is still tree-shaped, so when processing queries, we still basically have to traverse the entire index tree to get the results. Path-based indexes can support simple path expression queries very well, but for regular path expressions, it does not work very well.


Node-based index indexes each node through encoding technology. The structural relationship between nodes can be determined in constant time through encoding. It can support regular path expressions well, but for long path expressions, especially When the query generates many intermediate results, the join operation of the node index is expensive.


Path-based indexing and node-based indexing each have their own advantages and disadvantages, but they can complement each other. At present, in practical applications, node-based indexing is more widely used and the research is relatively mature. Therefore, Dameng Company's research on XML index structure mainly focuses on node-based indexing, and makes appropriate improvements with reference to path-based indexing.

The above is the content of XML data query technology that has become a hot research topic today. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

ArtGPT

ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT

Stock Market GPT

AI powered investment research for smarter decisions

Popular tool

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

JSON vs. XML: Why RSS Chose XML JSON vs. XML: Why RSS Chose XML May 05, 2025 am 12:01 AM

RSS chose XML instead of JSON because: 1) XML's structure and verification capabilities are better than JSON, which is suitable for the needs of RSS complex data structures; 2) XML was supported extensively at that time; 3) Early versions of RSS were based on XML and have become a standard.

Understanding RSS Documents: A Comprehensive Guide Understanding RSS Documents: A Comprehensive Guide May 09, 2025 am 12:15 AM

RSS documents are a simple subscription mechanism to publish content updates through XML files. 1. The RSS document structure consists of and elements and contains multiple elements. 2. Use RSS readers to subscribe to the channel and extract information by parsing XML. 3. Advanced usage includes filtering and sorting using the feedparser library. 4. Common errors include XML parsing and encoding issues. XML format and encoding need to be verified during debugging. 5. Performance optimization suggestions include cache RSS documents and asynchronous parsing.

Building XML Applications with C  : Practical Examples Building XML Applications with C : Practical Examples May 03, 2025 am 12:16 AM

You can use the TinyXML, Pugixml, or libxml2 libraries to process XML data in C. 1) Parse XML files: Use DOM or SAX methods, DOM is suitable for small files, and SAX is suitable for large files. 2) Generate XML file: convert the data structure into XML format and write to the file. Through these steps, XML data can be effectively managed and manipulated.

RSS, XML and the Modern Web: A Content Syndication Deep Dive RSS, XML and the Modern Web: A Content Syndication Deep Dive May 08, 2025 am 12:14 AM

RSS and XML are still important in the modern web. 1.RSS is used to publish and distribute content, and users can subscribe and get updates through the RSS reader. 2. XML is a markup language and supports data storage and exchange, and RSS files are based on XML.

Beyond Basics: Advanced RSS Features Enabled by XML Beyond Basics: Advanced RSS Features Enabled by XML May 07, 2025 am 12:12 AM

RSS enables multimedia content embedding, conditional subscription, and performance and security optimization. 1) Embed multimedia content such as audio and video through tags. 2) Use XML namespace to implement conditional subscriptions, allowing subscribers to filter content based on specific conditions. 3) Optimize the performance and security of RSSFeed through CDATA section and XMLSchema to ensure stability and compliance with standards.

Inside the RSS Document: Essential XML Tags and Attributes Inside the RSS Document: Essential XML Tags and Attributes May 03, 2025 am 12:12 AM

The core structure of RSS documents includes XML tags and attributes. The specific parsing and generation steps are as follows: 1. Read XML files, process and tags. 2. Extract,,, etc. tag information. 3. Handle custom tags and attributes to ensure version compatibility. 4. Use cache and asynchronous processing to optimize performance to ensure code readability.

Decoding RSS: An XML Primer for Web Developers Decoding RSS: An XML Primer for Web Developers May 06, 2025 am 12:05 AM

RSS is an XML-based format used to publish frequently updated data. As a web developer, understanding RSS can improve content aggregation and automation update capabilities. By learning RSS structure, parsing and generation methods, you will be able to handle RSSfeeds confidently and optimize your web development skills.

XML: Is it still used? XML: Is it still used? May 13, 2025 pm 03:13 PM

XMLisstillusedduetoitsstructurednature,humanreadability,andwidespreadadoptioninenterpriseenvironments.1)Itfacilitatesdataexchangeinsectorslikefinance(SWIFT)andhealthcare(HL7).2)Itshuman-readableformataidsinmanualdatainspectionandediting.3)XMLisusedin

Related articles