Entri Populer

Friday, April 15, 2011

XML Index

XML INDEX
xml index can be created on columns that have the xml data type, this index includes all tags, values ​​and path so that it can improve query performance.
applications that benefit from the xml index is; -Query on xml column is general in workload, xml index maintenance cost should be in calculated on data modification. Xml generally large-value and the part taken is usually small, making the index avoid parsing all the data and benefit index for query process
XML indexes are divided into two categories Xml Primary index Xml Secondary index
The first index on XML column must be the primary xml index, using xml index, xml secondary index can be supported: path, value, property. depend on the type query, xml secondary index may improve query performance.
xml instance is stored in column type xml as blobs. xml isntace can be sized great and save the xml data type binary form, size up to 2GB. without index, BLOB in the iris at run time to evaluate the query. This can take a lot of slicing time.

primary xml index primary xml index will index all the tags, values ​​and paths in the xml instance in xml column. to going to the xml indexes, tables in xml column should have a clustered index on the primary key in the table. sql server using the primary xml index row by row on the table that contains xml column. primary xml index was presented and excised from the xml xml BLOB column. for each xml BLOB in a column. index make some rows of data. many rows in the index is estimated to equal to the number nodes in the XML BLOB, when the query asks isntance full xml, sql server will provide instance of the xml column. query in xml intance using primary xml index, and return scalar value from the xml subtree using its own index.

each row stores information following node Name-tag Node-value -Type nodes such as element node, attribute node, or text node. Document-sequence information, which is represented by an internal node identifier -Path from each node up to root on the xml tree. Kery-primary of the base tables, primary key of the base tables, duplicated in the primary xml index back to join the base tables, and the maximum number of columns in a table primary key based in the limit 15


by looking at the primary xml index, rather than each xml BLOB shreeding isntance in base table, a corresponding row in the index with each XML BLOB in sequential search for expression that exists in the method exists (). if the path is found in the path column in index. The <summary> element together with subtreenya in retrieving the primary xml index and converted into an XML BLOB as a result of the query method.


xml secondary index type Xml-type secondary-path -Value -Property
The following is a guide to make one or more secondary indexes: 1.jika workload uses path expressions in the form of significantly in the xml column, SXI path will accelerate performance, general case using methods exist () 2.jika workload request values ​​from individual XML instances using the expression path, clustering paths in the xml instance of the property index will be useful. This scenario generally appear in the property bag scenarios, when the properties of an object in the fetch and primary key value is not known. 3.jika workload contains a query value in the xml instance, without knowing the name of the element or attribute that contains the value. value index. usually appears with the search derivatives, such as / / author [last-name = 'howard'] Nowhere <author> Dapa element appears at all levels of hierarchy. This also appears in the query was a wildcard, such as / book [@*=' novel "], where the query to see who has the book element novel attributes.

No comments:

Post a Comment