•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 456,442 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,626 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser: Programming Forums
Views: 9897 | Replies: 79
![]() |
•
•
Join Date: Oct 2007
Posts: 36
Reputation:
Rep Power: 2
Solved Threads: 0
There are 3 types of XML Indexes.
XML regions index is one such index which stores the locations of each XML document that is stored in XML storage area. There is one region index created by DB2 for each table having a XML column. This region index is automatically created and maintained by DB2.
The other 2 indexes are XML column path index and Index on an XML column.
XML column path index - This index is system-generated for each XML column created or added to the table. For example, if a table with two XML columns is created, there is one XML regions index, but two XML column path indexes generated by DB2 9.
Index on an XML column (XML index) - This index is created over an XML column. You can index every XML path in an XML column using XPath. Like other relational indexes, the XML index is created as a B-tree structure and stored in the same place as the relational indexes are stored. Multiple XML indexes can be defined in one XML column. Please check section 5.1 on http://www.redbooks.ibm.com/redbooks/pdfs/sg247298.pdf for information on this.
XML regions index is one such index which stores the locations of each XML document that is stored in XML storage area. There is one region index created by DB2 for each table having a XML column. This region index is automatically created and maintained by DB2.
The other 2 indexes are XML column path index and Index on an XML column.
XML column path index - This index is system-generated for each XML column created or added to the table. For example, if a table with two XML columns is created, there is one XML regions index, but two XML column path indexes generated by DB2 9.
Index on an XML column (XML index) - This index is created over an XML column. You can index every XML path in an XML column using XPath. Like other relational indexes, the XML index is created as a B-tree structure and stored in the same place as the relational indexes are stored. Multiple XML indexes can be defined in one XML column. Please check section 5.1 on http://www.redbooks.ibm.com/redbooks/pdfs/sg247298.pdf for information on this.
•
•
Join Date: Oct 2007
Posts: 36
Reputation:
Rep Power: 2
Solved Threads: 0
Region index is automatically created and maintained by DB2 for each table that has a XML column. Whenever the inserted XML document has a larger size than that of the database page size, DB2 automatically splits the XML document to fit it into multiple database pages. The region index is used to maintain the logical mapping between these split sub-documents. By splitting the XML document page-wise, DB2 is able to make use of the relational database facilities like prefetching.
•
•
Join Date: Oct 2007
Posts: 36
Reputation:
Rep Power: 2
Solved Threads: 0
Like indexes on relational data, using indexes on an XML column to improve the query performance may have some cost. The performance for INSERT, UPDATE, and DELETE can decrease as the number of indexes defined on XML column increases. Indexes also take space, so you should only create indexes that are really necessary.
•
•
Join Date: Oct 2007
Posts: 36
Reputation:
Rep Power: 2
Solved Threads: 0
The CREATE INDEX statement has been enhanced to support XML indexing. XML indexes are created on columns of type XML based on path expressions (xmlpattern). When creating an XML index, the following fields are required:
Index name: Specify the name of an XML index.
Table and column names: Specify which XML column is indexed.
XMLPATTERN: Specify the node you want to index.
Data type: Specify the SQL data type for the XML index.
For eg. CREATE INDEX xidx1 on PRODUCT(XMLDOC)
GENERATE KEY USING XMLPATTERN
‘/products/product/id’ as SQL DOUBLE
This will create a XML index on the XMLDOC column of the PRODUCT table.
The index xidx1 will have all the product id values indexed with their data type being DOUBLE.
You can check section 5.1.2 on http://www.redbooks.ibm.com/redbooks/pdfs/sg247298.pdf link for more information on this.
Index name: Specify the name of an XML index.
Table and column names: Specify which XML column is indexed.
XMLPATTERN: Specify the node you want to index.
Data type: Specify the SQL data type for the XML index.
For eg. CREATE INDEX xidx1 on PRODUCT(XMLDOC)
GENERATE KEY USING XMLPATTERN
‘/products/product/id’ as SQL DOUBLE
This will create a XML index on the XMLDOC column of the PRODUCT table.
The index xidx1 will have all the product id values indexed with their data type being DOUBLE.
You can check section 5.1.2 on http://www.redbooks.ibm.com/redbooks/pdfs/sg247298.pdf link for more information on this.
![]() |
•
•
•
•
•
•
•
•
DaniWeb RSS, Web Services and SOAP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
accounting software selection api apple asp bebo blogger blogging business software cd code development digital dom drama drm erp systems evaluations feed gdata google html ipod katemodern key linspire linux lonelygirl15 management microsoft mp3 news programming project management reader rights ripping rss soap software selection standards technology evaluation tv video w3c weather web xml xoap youtube zune
- Ezines (E-mail Management System) (eCommerce)
- Contract: Java, JSP, J2EE, XML & Fuego - USA (anywhere) (Web Development Job Offers)
- Windows XP and RAM Management (Windows NT / 2000 / XP / 2003)
- Senior Configuration Management/Build Engineer (Software Development Job Offers)
- Java XML Developer London WC1 (Web Development Job Offers)
- xml parser to validate xml files-Urgent (XML, XSLT and XPATH)
- How XML can be used in place of any database management system. (RSS, Web Services and SOAP)
- How are you making use of xml? (XML, XSLT and XPATH)
- over heating (Cases, Fans and Power Supplies)
- Processor (Windows NT / 2000 / XP / 2003)
Other Threads in the RSS, Web Services and SOAP Forum
- Previous Thread: session variable
- Next Thread: XML Update??


Linear Mode