Shankar Pal and 10 other Microsoft folks (including Michael Rys) authored the "XQuery Implementation in a Relational Database" technical paper, which was presented at the 31st Very Large Data Bases Conference in Trondheim, Norway on August 30, 2005. If you've wondered what the XmlOp_Select, XmlOp_Path, XmlOp_Apply, XmlOp_Compare, XmlOp_Constant, XmlOp_Construct, and XmlOp_Function operators do, this paper will satisfy your curiousity. The paper also covers XML operator mapping, plus related and future XQuery work. Bob Beauchemin, who abandoned Developmentor for SQL Server maven Kimberly Tripp's SQLskills.com has written an "XML Indexes in SQL Server 2005" whitepaper for MSDN. Bob's explanations of PRIMARY, PATH, VALUE, and PROPERTY indexes for the xml data type supplement those in my "Exploit Yukon's XML Data Type" article from Visual Studio Magazine. Bob's article is a substantially easier read than Shankar Pal, et al.'s "Indexing XML Data Stored in a Relational Database" paper from last year's Very Large Data Bases symposium. You can download the VB 2005 code for my XQuery.sln WinForms project, which adds two xml columns—one simple and one complex—to the Northwind Orders table and lets you add an XML schema for the documents in each column. Then you can measure the time to create primary or multiple XML indexes on the columns, as shown here: You also can test the effect of indexes on the execution of XQuery expressions by comparing execution times for various index combinations, as illustrated here:
The app contains a high-resolution timer class but accurate comparative tests of index performance require more than the initial 830 rows of the Northwind Orders table.
Chapter 12, "Exploring the xml Data Type" of my Expert One-on-One Visual Basic 2005 Database Programming book has a more sophisticated version of the XQuery project and a utility program for creating an Orders table clone that has a number of basic and namespace-qualified document instances limited only by your available diskspace, patience, or both. --rj
P.S. Thanks to Karen Watterson for the link to Bob Beauchemin's article.