SlideShare a Scribd company logo
XML Indexing StrategiesChoosing the Right Index for the Right JobMarco Gralike
Strange Chainsaw Tree GuyOakTable MemberACE DirectorCustomer Advisory Board Member17+ years DBA, etc.Blog.gralike.comTechnology.amis.nl
Richard Foote (Mr. Index)OakTable MemberACE DirectorOracle Certified Professional22+ years DBA, etc.RichardFoote.wordpress.com
Refinement
Structured or Semi-Structured or…StructuredSemiStructured
Unstructured Content
Document Driven / Data Driven
Design: Width and Height and …13452XY6ZContent Height: minOccurs="0" maxOccurs=“unbounded”Content Width: type="xs:string“, restriction…?Content Distribution: histogram, statistics, skew, cardinality ?
XMLType “Under the Hood”DOM Tree ModelXQuerySQL/XMLXMLType AbstractionProcedural XQueryDB XQueryXVM                               (use “no query rewrite”)XQuery RewritePushdownSQL ExecutionXMLIndexStreaming XPath EvaluationRelationalAccess MethodsBinary XMLObject-RelationalRelational StorageSecure FilesSource OOW 2010 presentation S317428:  Building Really Scalable XML Applications with Oracle XML DB and Oracle Text
Miracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011  -  XML Index Strategies
Miracle Open World 2011  -  XML Index Strategies
XML Storage/Index Use CasesBinary XML(Schema based)XMLIndex Structured Component
XMLTypeIn Memory(document)CLOB(document)Object Relational(data)Binary XML(data)
XMLType Storage ModelsCLOBDefault until 11.2.0.2.0Non-Schema BasedBinary XMLOracle 11 and OnwardsSchema and Non-Schema BasedObject Relational (+Hybrid)Nested Tables, Types, Varray’sSchema Based
Storage Index Defaults (xmltype)Binary XML / CLOBLOB IndexObject RelationalDBMS_XMLSCHEMA  “OPTIONS”Oracle 10g: Index Organized TablesOracle 11g: B-Tree Indexesxdb:annotationsStorage type xdb:SQLTypeStorage Typexdb:ColumnProps / xdb:TableProps
Index Methods (xmltype)CLOBOracle Text
XMLIndex (>= 11g)Binary XMLXMLIndex  / Oracle Text
Virtual Columns (BTree)Object Relational Standard Indexes
Oracle TextIndex Methods (10.x)BTree IndexBTree IBTbookstoreOracle Text IndexFunction based Index (XPath)bookwhitepapertitleauthorauthorchaptertitleauthoridparagraphcontentcontent
Function-Based IndexDeprecated in 11.2Object Relational XMLType Storage(can be used, but shouldn’t, on CLOB)Performance wise the lesser option…SQL> 	CREATE INDEX function_based_index		ON xml_data_table		(extractValue(OBJECT_VALUE, '/Root/TextID'));
BTree / Bitmap Index (O.R.)Structured XML DataOrdered Collection Tables (OCT)ComplexTypes…“dot” notation using the “xmldata” pseudocolumnSQL> 	CREATE INDEX dot_notation_index		ON xml_data_table		("XMLDATA". "TEXTID");
Syntax Index AlternativesSQL> 	CREATE INDEX function_based_again_idx		ON xml_data_table		(CAST("XMLDATA". "TEXTID“ as VARCHAR2(10)));SQL> 	CREATE INDEX oracle_11_applicable_only_index	ON xml_data_tablexdt	(XMLCast(XMLQuery('$i/Root/TextID'                    PASSING xdt.OBJECT_VALUE as "i"                     RETURNING content)as VARCHAR2(10)));
Oracle Text IndexUnstructured Data in XMLCLOB storage XML part in Object Relational XMLSecondary index on XMLIndexCan only index XML data TEXT nodesResult Set Interface (new in 11.2.0.2)Specify Query request and hit list requirements in XMLSQL> 	CREATE INDEX oracle_text_index		ON xml_data_table		      (OBJECT_VALUE) INDEXTYPE IS CTXSYS.CONTEXT;
Index Methods (11.1)BTree IndexBTree IBTbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontent
XML Document contains:Semi Structured Data and Structured DataSupports searching and fragment extractionWhen XPath queried is not known beforehandXMLType CLOB or Binary XML contentIf you use an XMLIndex and/or combine it with Structured XMLIndex(es)Usage: Unstructured XMLIndex
Simple: Unstructured XMLIndexSQL> 	CREATEINDEXxmlindex_idx		ON  “XMLTYPE_COLUMN"(xdata) INDEXTYPEISXDB.XMLINDEX;Index created.SQL> 	CREATEINDEXxmlindex_idx		ON  “XMLTYPE_TABLE"(object_value) INDEXTYPEISXDB.XMLINDEX;Index created.
Creating Unstructured XMLIndexCREATEINDEXXMLIDX ON 		   XMLBINARY_TAB (object_value) INDEXTYPEISXDB.XMLIndexPARAMETERS 	('PATHS (INCLUDE (/ROOT/ID /ROOT/INFO/INFO_ID ) NAMESPACEMAPPING(xmlns="http://localhost/xmlschema_bin.xsd") ) PATH TABLE 	       	path_table(TABLESPACE XML_DATA)PATH ID INDEX          	pathid_idx        (TABLESPACE XML_INDX)ORDER KEY INDEX   	orderkey_idx    (TABLESPACE XML_INDX)VALUE INDEX           	value_idx          (TABLESPACE XML_INDX)ASYNC (SYNC ALWAYS) STALE (FALSE) ') PARALLEL LOGGING;
Path TablePATH TABLEPATH INDEX(PATHID, RID), BTREEORDER INDEX(RID, ORDER_KEY), BTREEVALUE INDEX(SUBSTRB("VALUE",1,1599))FUNCTION BASEDSECONDAIRY INDEXESUnstructuredXMLIndexf (x)Path Table
Unstructured XMLIndex (UXI)OnePath Table
UsePath Subsetting
Full Blown XMLIndex canbe BIG
Token Tables (XDB.X$......)
Query re-writeonTokens
FuzzySearches, //
OptimizerStatistics
CanbemaintainedManually
Recorded inPending Table
SecondairyindexespossibleUnstructuredXMLIndexf (x)Path Table
Index Methods (11.2)BTree IndexBTree IBTbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperStructuredXMLIndexUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontentHighly StructuredIslands of Data
With highly Structured DataLikely candidates: ComplexTypesStructured Islands of DataCan be nested, but officially only one levelXMLTABLE “virtual” nested column hintWill create (multiple) “Content Tables” Multiple XPath defined same columns with different purposeThey deliver relational performance…!Usage: Structured XMLIndex
Simple: Structured XMLIndex“XMLTABLE” Driven SyntaxSQL> CREATE INDEX xmlindex_sxi           on xml_data_table (xmlcol) indextype is xdb.xmlindex           parameters               ('GROUP employee_info_groupXMLTABLEEMP_CONTENT_TABLE                ' '/employees/emp' '                 COLUMNS empidNUMBER(10) PATH ' 'id' '  '); Be aware' '
Content Table(s)KEY INDEX(KEY)
Unique BTREE Index
PrimaryKeyRID INDEX(RID)

More Related Content

PPTX
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
PPTX
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
PPTX
Oracle Database 11g Release 2 - XMLDB New Features
PPTX
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
PPT
XML Amsterdam - Creating structure in unstructured data
PPTX
Hotsos 2013 - Creating Structure in Unstructured Data
PPTX
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
PPTX
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...
UKOUG 2010 (Birmingham) - XML Indexing strategies - Choosing the Right Index ...
Oracle Developer Day, 20 October 2009, Oracle De Meern, Holland: Oracle Datab...
Oracle Database 11g Release 2 - XMLDB New Features
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
XML Amsterdam - Creating structure in unstructured data
Hotsos 2013 - Creating Structure in Unstructured Data
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
OakTable World 2015 - Using XMLType content with the Oracle In-Memory Column...

What's hot (20)

PPTX
ODTUG Webcast - Thinking Clearly about XML
PPTX
BGOUG 2012 - XML Index Strategies
PPTX
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
PPTX
XFILES, The APEX 4 version - The truth is in there
PDF
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
PPTX
BGOUG 2012 - Design concepts for xml applications that will perform
PPTX
Starting with JSON Path Expressions in Oracle 12.1.0.2
PPT
XML In The Real World - Use Cases For Oracle XMLDB
PDF
UKOUG Tech14 - Getting Started With JSON in the Database
PPT
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
PPT
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
PPT
Jdbc 4.0 New Features And Enhancements
PPT
Xml parsers
PPTX
Oracle Database - JSON and the In-Memory Database
PPTX
JSON in der Oracle Datenbank
PDF
Polyglot Persistence
PDF
Cloudera Impala, updated for v1.0
PDF
wtf is in Java/JDK/wtf7?
KEY
Object Relational Mapping in PHP
PPTX
Database Programming
ODTUG Webcast - Thinking Clearly about XML
BGOUG 2012 - XML Index Strategies
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
XFILES, The APEX 4 version - The truth is in there
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
BGOUG 2012 - Design concepts for xml applications that will perform
Starting with JSON Path Expressions in Oracle 12.1.0.2
XML In The Real World - Use Cases For Oracle XMLDB
UKOUG Tech14 - Getting Started With JSON in the Database
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
Jdbc 4.0 New Features And Enhancements
Xml parsers
Oracle Database - JSON and the In-Memory Database
JSON in der Oracle Datenbank
Polyglot Persistence
Cloudera Impala, updated for v1.0
wtf is in Java/JDK/wtf7?
Object Relational Mapping in PHP
Database Programming
Ad

Similar to Miracle Open World 2011 - XML Index Strategies (20)

PPTX
advDBMS_XML.pptx
PPTX
PostgreSQL's Secret NoSQL Superpowers
PDF
NyaruDBにゃるものを使ってみた話 (+Realm比較)
PDF
Compass Framework
PDF
Oracle Text in APEX
PPT
Sql Summit Clr, Service Broker And Xml
PPTX
NoSQL Endgame DevoxxUA Conference 2020
PPTX
Spark Sql and DataFrame
PPT
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
PDF
Import web resources using R Studio
PPTX
JakartaData-JCon.pptx
PPT
What's New for Developers in SQL Server 2008?
PPT
SQL Server 2008 Overview
PDF
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
PPT
Xml sasidhar
PPTX
NoSQL Endgame Percona Live Online 2020
PDF
Spark SQL Deep Dive @ Melbourne Spark Meetup
KEY
Summer - The HTML5 Library for Java and Scala
PPT
XML stands for EXtensible Markup Language
PPT
XMLLec1.pptsfsfsafasfasdfasfdsadfdsfdf dfdsfds
advDBMS_XML.pptx
PostgreSQL's Secret NoSQL Superpowers
NyaruDBにゃるものを使ってみた話 (+Realm比較)
Compass Framework
Oracle Text in APEX
Sql Summit Clr, Service Broker And Xml
NoSQL Endgame DevoxxUA Conference 2020
Spark Sql and DataFrame
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
Import web resources using R Studio
JakartaData-JCon.pptx
What's New for Developers in SQL Server 2008?
SQL Server 2008 Overview
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Xml sasidhar
NoSQL Endgame Percona Live Online 2020
Spark SQL Deep Dive @ Melbourne Spark Meetup
Summer - The HTML5 Library for Java and Scala
XML stands for EXtensible Markup Language
XMLLec1.pptsfsfsafasfasdfasfdsadfdsfdf dfdsfds
Ad

More from Marco Gralike (13)

PPTX
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
PPTX
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
PPTX
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
PPTX
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
PPTX
Ordina Oracle Open World
PDF
An introduction into Oracle VM V3.x
PDF
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
PPTX
An AMIS Overview of Oracle database 12c (12.1)
PPTX
Flexibiliteit & Snel Schakelen
PPTX
Expertezed 2012 Webcast - XML DB Use Cases
PPTX
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
PPT
Amis ACE
PPTX
Design Concepts For Xml Applications That Will Perform
UKOUG2018 - I Know what you did Last Summer [in my Database].pptx
eProseed Oracle Open World 2016 debrief - Oracle Management Cloud
eProseed Oracle Open World 2016 debrief - Oracle 12.2.0.1 Database
UKOUG Tech15 - Going Full Circle - Building a native JSON Database API
Ordina Oracle Open World
An introduction into Oracle VM V3.x
An introduction into Oracle Enterprise Manager Cloud Control 12c Release 3
An AMIS Overview of Oracle database 12c (12.1)
Flexibiliteit & Snel Schakelen
Expertezed 2012 Webcast - XML DB Use Cases
BGOUG 2012 - Drag & drop and other stuff - Using your database as a file server
Amis ACE
Design Concepts For Xml Applications That Will Perform

Recently uploaded (20)

PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Machine Learning_overview_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
OMC Textile Division Presentation 2021.pptx
Heart disease approach using modified random forest and particle swarm optimi...
Digital-Transformation-Roadmap-for-Companies.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Machine Learning_overview_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25-Week II
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
OMC Textile Division Presentation 2021.pptx

Miracle Open World 2011 - XML Index Strategies

  • 1. XML Indexing StrategiesChoosing the Right Index for the Right JobMarco Gralike
  • 2. Strange Chainsaw Tree GuyOakTable MemberACE DirectorCustomer Advisory Board Member17+ years DBA, etc.Blog.gralike.comTechnology.amis.nl
  • 3. Richard Foote (Mr. Index)OakTable MemberACE DirectorOracle Certified Professional22+ years DBA, etc.RichardFoote.wordpress.com
  • 5. Structured or Semi-Structured or…StructuredSemiStructured
  • 7. Document Driven / Data Driven
  • 8. Design: Width and Height and …13452XY6ZContent Height: minOccurs="0" maxOccurs=“unbounded”Content Width: type="xs:string“, restriction…?Content Distribution: histogram, statistics, skew, cardinality ?
  • 9. XMLType “Under the Hood”DOM Tree ModelXQuerySQL/XMLXMLType AbstractionProcedural XQueryDB XQueryXVM (use “no query rewrite”)XQuery RewritePushdownSQL ExecutionXMLIndexStreaming XPath EvaluationRelationalAccess MethodsBinary XMLObject-RelationalRelational StorageSecure FilesSource OOW 2010 presentation S317428: Building Really Scalable XML Applications with Oracle XML DB and Oracle Text
  • 16. XML Storage/Index Use CasesBinary XML(Schema based)XMLIndex Structured Component
  • 18. XMLType Storage ModelsCLOBDefault until 11.2.0.2.0Non-Schema BasedBinary XMLOracle 11 and OnwardsSchema and Non-Schema BasedObject Relational (+Hybrid)Nested Tables, Types, Varray’sSchema Based
  • 19. Storage Index Defaults (xmltype)Binary XML / CLOBLOB IndexObject RelationalDBMS_XMLSCHEMA  “OPTIONS”Oracle 10g: Index Organized TablesOracle 11g: B-Tree Indexesxdb:annotationsStorage type xdb:SQLTypeStorage Typexdb:ColumnProps / xdb:TableProps
  • 21. XMLIndex (>= 11g)Binary XMLXMLIndex / Oracle Text
  • 22. Virtual Columns (BTree)Object Relational Standard Indexes
  • 23. Oracle TextIndex Methods (10.x)BTree IndexBTree IBTbookstoreOracle Text IndexFunction based Index (XPath)bookwhitepapertitleauthorauthorchaptertitleauthoridparagraphcontentcontent
  • 24. Function-Based IndexDeprecated in 11.2Object Relational XMLType Storage(can be used, but shouldn’t, on CLOB)Performance wise the lesser option…SQL> CREATE INDEX function_based_index ON xml_data_table (extractValue(OBJECT_VALUE, '/Root/TextID'));
  • 25. BTree / Bitmap Index (O.R.)Structured XML DataOrdered Collection Tables (OCT)ComplexTypes…“dot” notation using the “xmldata” pseudocolumnSQL> CREATE INDEX dot_notation_index ON xml_data_table ("XMLDATA". "TEXTID");
  • 26. Syntax Index AlternativesSQL> CREATE INDEX function_based_again_idx ON xml_data_table (CAST("XMLDATA". "TEXTID“ as VARCHAR2(10)));SQL> CREATE INDEX oracle_11_applicable_only_index ON xml_data_tablexdt (XMLCast(XMLQuery('$i/Root/TextID' PASSING xdt.OBJECT_VALUE as "i" RETURNING content)as VARCHAR2(10)));
  • 27. Oracle Text IndexUnstructured Data in XMLCLOB storage XML part in Object Relational XMLSecondary index on XMLIndexCan only index XML data TEXT nodesResult Set Interface (new in 11.2.0.2)Specify Query request and hit list requirements in XMLSQL> CREATE INDEX oracle_text_index ON xml_data_table (OBJECT_VALUE) INDEXTYPE IS CTXSYS.CONTEXT;
  • 28. Index Methods (11.1)BTree IndexBTree IBTbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontent
  • 29. XML Document contains:Semi Structured Data and Structured DataSupports searching and fragment extractionWhen XPath queried is not known beforehandXMLType CLOB or Binary XML contentIf you use an XMLIndex and/or combine it with Structured XMLIndex(es)Usage: Unstructured XMLIndex
  • 30. Simple: Unstructured XMLIndexSQL> CREATEINDEXxmlindex_idx ON “XMLTYPE_COLUMN"(xdata) INDEXTYPEISXDB.XMLINDEX;Index created.SQL> CREATEINDEXxmlindex_idx ON “XMLTYPE_TABLE"(object_value) INDEXTYPEISXDB.XMLINDEX;Index created.
  • 31. Creating Unstructured XMLIndexCREATEINDEXXMLIDX ON XMLBINARY_TAB (object_value) INDEXTYPEISXDB.XMLIndexPARAMETERS ('PATHS (INCLUDE (/ROOT/ID /ROOT/INFO/INFO_ID ) NAMESPACEMAPPING(xmlns="http://localhost/xmlschema_bin.xsd") ) PATH TABLE path_table(TABLESPACE XML_DATA)PATH ID INDEX pathid_idx (TABLESPACE XML_INDX)ORDER KEY INDEX orderkey_idx (TABLESPACE XML_INDX)VALUE INDEX    value_idx   (TABLESPACE XML_INDX)ASYNC (SYNC ALWAYS) STALE (FALSE) ') PARALLEL LOGGING;
  • 32. Path TablePATH TABLEPATH INDEX(PATHID, RID), BTREEORDER INDEX(RID, ORDER_KEY), BTREEVALUE INDEX(SUBSTRB("VALUE",1,1599))FUNCTION BASEDSECONDAIRY INDEXESUnstructuredXMLIndexf (x)Path Table
  • 35. Full Blown XMLIndex canbe BIG
  • 43. Index Methods (11.2)BTree IndexBTree IBTbookstoreSecondary Oracle Text IndexFunction based Index (XPath)bookwhitepaperStructuredXMLIndexUnstructuredXMLIndextitleauthorauthorchaptertitleauthoridparagraphcontentcontentHighly StructuredIslands of Data
  • 44. With highly Structured DataLikely candidates: ComplexTypesStructured Islands of DataCan be nested, but officially only one levelXMLTABLE “virtual” nested column hintWill create (multiple) “Content Tables” Multiple XPath defined same columns with different purposeThey deliver relational performance…!Usage: Structured XMLIndex
  • 45. Simple: Structured XMLIndex“XMLTABLE” Driven SyntaxSQL> CREATE INDEX xmlindex_sxi on xml_data_table (xmlcol) indextype is xdb.xmlindex parameters ('GROUP employee_info_groupXMLTABLEEMP_CONTENT_TABLE ' '/employees/emp' ' COLUMNS empidNUMBER(10) PATH ' 'id' ' '); Be aware' '
  • 49. NON Unique BTREE IndexYour ColumnsRIDrowidYOURcolumnXKeyRAWNot nullRIDrowidKeyRAWNot nullYOURcolumnsXCONTENT TABLE(s)YOURcolumnsXRIDrowidKeyRAWNot null
  • 50. Structured XMLIndex (SXI)Content Table(s)BasedonXMLTABLEsyntaxXMLTable construct canbenestedbut:“Only ONE XMLType column allowed” VIRTUAL columnCanbemaintainedManuallySecondairyindexespossibleLOCAL parameter (partitioning)StructuredXMLIndexf (x)ContentTables
  • 51. Adding Structured IndexesSQL> ALTER INDEX xmlindex_sxiparameters ('ADD_GROUP GROUP my_new_group XMLTABLE xml_content_tab_new ' '/root/extra' ' COLUMNS extracol VARCHAR2(35) PATH ' 'new_element' ' ');
  • 52. Mixed XMLIndex OptionsbookstoreSecondary (text)IndexUnstructuredXMLIndexbookwhitepaperStructuredXMLIndexStructuredXMLIndextitleauthorauthorparagraphtitleauthoridchaptercontentcontent
  • 53. Mixed XMLIndex structuresCREATE INDEX xmlindex on TEST_RANGE_XML (doc) indextype is xdb.xmlindexPARAMETERS (' PATH TABLE path_table PATHS (EXCLUDE(/root/ElementInfo)) '); BEGIN DBMS_XMLINDEX.registerParameter ('StructuredXML', 'ADD_GROUP GROUP ElementInfoXMLTABLExml_cnttable_valueinfo ' '/root/ElementInfo' ' COLUMNS ValueInfo VARCHAR2(100) PATH ' 'ValueInfo' '); END; /ALTER INDEX xmlindex PARAMETERS('PARAM StructuredXML');
  • 54. XMLIndex MaintenanceALTER INDEXXMLIndex Parameter ChangesDBMS_XMLINDEX.DROPPARAMETERDBMS_XMLINDEX.MODIFYPARAMETERDBMS_XMLINDEX.REGISTERPARAMETERManual Synchronizing an XMLIndexDBMS_XMLINDEX.SYNCINDEX Pending Tables
  • 55. “There Can Be Only One…”
  • 56. Syntax AwarenessSYNC=ALWAYSMandatory when Combined XMLIndexSYNC=MANUALLockingSTALE=FALSE | TRUEHmmm…Empty XMLIndex tablesOOPS  I got my “XMLTABLE” Syntax etc. “wrong”
  • 57. Notes on XMLIndex (1)Only ONE XMLIndex is allowed in a user schemaAdd extra XMLIndex structures (structured or unstructured) via ADD_GROUP syntaxOnly SYNC=ALWAYS is allowed while using mixed XMLIndex structures or add more than one
  • 58. Notes on XMLIndex (2)You need the LOCAL parameter to create local partitioned XMLIndexesAn XMLIndex on a HASH partitioned XMLType column or XMLType table, isnot (yet) allowedBut you can create an Oracle Text Index on such structures
  • 59. RecapTrue understanding of Storage and Index options will provide:Optimal performanceOut perform XML (Java based)A lot of choice:Problems are ComplexAlso provides SolutionsGood design beforehand is the path to success
  • 60. References (1)Oracle WhitepapersOracle XML DB : Choosing the Best XMLType Storage Option for Your Use Case (PDF)Oracle XML DB : Best Practices to Get Optimal Performance out of XML Queries (PDF)Bloghttp://blog.gralike.com (Dedicated XMLDB blog)Semi-Structured XMLIndex sectionStructured XMLIndex section
  • 61. References (2)Oracle Open World Presentationon XML DBS317428: Building Really Scalable XML Applications with Oracle XML DB and Oracle TextXML DB OTN / FAQ Threadhttp://forums.oracle.com/forums/forum.jspa?forumID=34 http://forums.oracle.com/forums/thread.jspa?threadID=410714

Editor's Notes

  • #5: It all comes down to packaging
  • #6: Definitions of Structured, Semi-Structured and Unstructured data
  • #9: Emp/Dept tables, Foreign/Primary Keys…Showing here ONLY 1 XML document…
  • #10: See also OOW 2010, S317428: Building Really Scalable XML Applications with Oracle XML DB and Oracle Text – Nipun Agarwal, Oracle