可以使用 all_xmltags 参数对列中的所有标记建立索引。
<book> <title>Graph Theory</title> <author>Stewart</author> <date edition="second">January 14, 2006</date> </book>
CREATE INDEX book_bts ON books(xml_data bts_lvarchar_ops) USING bts(all_xmltags="yes") IN bts_sbspace;
title:graph theory author:stewart date:january 14, 2006
将不对顶级的 <book></book> 标记建立索引,因为这些标记不包含文本值。也不会对 edition 属性建立索引。
CREATE INDEX book_bts ON books(xml_data bts_lvarchar_ops) USING bts(all_xmltags="yes",xmlpath_processing=”yes”) IN bts_sbspace;
/book/title:graph theory /book/author:stewart /book/date:january 14, 2006