SlideShare a Scribd company logo
XML Indexing StrategiesChoosing the Right Index for the Right Job Marco Gralike
Strange Chainsaw Tree Guy OakTable Member ACE Director Customer Advisory Board Member 17+ years DBA, etc. Blog.gralike.com Technology.amis.nl
Richard Foote (Mr. Index) OakTable Member ACE Director Oracle Certified Professional 22+ years DBA, etc. RichardFoote.wordpress.com
Refinement
Structured or Semi-Structured or… Structured Semi Structured
Unstructured Content
Document Driven / Data Driven
Design: Width and Height and … 1 3 4 5 2 X Y 6 Z Content Height: minOccurs="0" maxOccurs=“unbounded” Content Width: type="xs:string“, restriction…? Content Distribution: histogram, statistics, skew, cardinality ?
XMLType “Under the Hood” DOM Tree Model XQuery SQL/XML XMLType Abstraction Procedural XQuery DB XQuery XVM                               (use “no query rewrite”) XQuery Rewrite Pushdown SQL Execution XMLIndex Streaming XPath Evaluation RelationalAccess Methods Binary XML Object-Relational Relational Storage Secure Files Source OOW 2010 presentation S317428:  Building Really Scalable XML Applications with Oracle XML DB and Oracle Text
XML Storage/Index Use Cases Binary XML (Schema based) XMLIndex Structured Component
XMLType In Memory (document) CLOB (document) Object Relational (data) Binary XML (data)
XMLType Storage Models CLOB Default until 11.2.0.2.0 Non-Schema Based Binary XML Oracle 11 and Onwards Schema and Non-Schema Based Object Relational (+Hybrid) Nested Tables, Types, Varray’s Schema Based
Storage Index Defaults (xmltype) Binary XML / CLOB LOB Index Object Relational DBMS_XMLSCHEMA  “OPTIONS” Oracle 10g: Index Organized Tables Oracle 11g: B-Tree Indexes xdb:annotations Storage type xdb:SQLType Storage Typexdb:ColumnProps / xdb:TableProps
Index Methods (xmltype) CLOB ,[object Object]
XMLIndex (>= 11g)Binary XML ,[object Object]
Virtual Columns (BTree)Object Relational ,[object Object]
Oracle Text,[object Object]
Function-Based Index Deprecated in 11.2 Object 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 Data Ordered Collection Tables (OCT) ComplexTypes… “dot” notation using the “xmldata” pseudocolumn SQL> 	CREATE INDEX dot_notation_index 		ON xml_data_table 		("XMLDATA". "TEXTID");
Syntax Index Alternatives SQL> 	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 Index Unstructured Data in XML CLOB storage XML part in Object Relational XML Secondary index on XMLIndex Can only index XML data TEXT nodes Result Set Interface (new in 11.2.0.2) Specify Query request and hit list requirements in XML SQL> 	CREATE INDEX oracle_text_index 		ON xml_data_table 		      (OBJECT_VALUE) INDEXTYPE IS CTXSYS.CONTEXT;
Index Methods (11.1) BTree Index BTree I BT bookstore Secondary Oracle Text Index Function based Index (XPath) book whitepaper Unstructured XMLIndex title author author chapter title author id paragraph content content
XML Document contains: Semi Structured Data and Structured Data Supports searching and fragment extraction When XPath queried is not known beforehand XMLType CLOB or Binary XML content If you use an XMLIndex and/or combine it with Structured XMLIndex(es) Usage: Unstructured XMLIndex
Simple: Unstructured XMLIndex SQL> 	CREATEINDEXxmlindex_idx 		ON  “XMLTYPE_COLUMN"(xdata)  INDEXTYPEISXDB.XMLINDEX; Index created. SQL> 	CREATEINDEXxmlindex_idx 		ON  “XMLTYPE_TABLE"(object_value)  INDEXTYPEISXDB.XMLINDEX; Index created.
Creating Unstructured XMLIndex CREATEINDEXXMLIDX  ON 		   XMLBINARY_TAB (object_value)  INDEXTYPEISXDB.XMLIndex PARAMETERS  	('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 Table PATH TABLE PATH INDEX ,[object Object],ORDER INDEX ,[object Object],VALUE INDEX ,[object Object],1599)) ,[object Object],SECONDAIRY INDEXES Unstructured XMLIndex f (x) Path Table
Unstructured XMLIndex (UXI) ,[object Object]
UsePath Subsetting
Full Blown XMLIndex canbe BIG
Token Tables (XDB.X$......)
Query re-writeonTokens
FuzzySearches, //
OptimizerStatistics
CanbemaintainedManually
Recorded inPending Table
SecondairyindexespossibleUnstructured XMLIndex f (x) Path Table
Index Methods (11.2) BTree Index BTree I BT bookstore Secondary Oracle Text Index Function based Index (XPath) book whitepaper Structured XMLIndex Unstructured XMLIndex title author author chapter title author id paragraph content content Highly Structured Islands of Data
With highly Structured Data Likely candidates: ComplexTypes Structured Islands of Data Can be nested, but officially only one level XMLTABLE “virtual” nested column hint Will create (multiple) “Content Tables”  Multiple XPath defined same columns with different purpose They deliver relational performance…! Usage: Structured XMLIndex
Simple: Structured XMLIndex “XMLTABLE” Driven Syntax SQL> CREATE INDEX xmlindex_sxi            on xml_data_table (xmlcol)  indextype is xdb.xmlindex            parameters                ('GROUP employee_info_group XMLTABLEEMP_CONTENT_TABLE                 ' '/employees/emp' '                  COLUMNS  empidNUMBER(10) PATH ' 'id' '  ');  Be aware ' '
Content Table(s) KEY INDEX ,[object Object]
Unique BTREE Index
PrimaryKeyRID INDEX ,[object Object]

More Related Content

What's hot

ODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XMLODTUG Webcast - Thinking Clearly about XML
ODTUG Webcast - Thinking Clearly about XML
Marco Gralike
 
BGOUG 2012 - XML Index Strategies
BGOUG 2012 - XML Index StrategiesBGOUG 2012 - XML Index Strategies
BGOUG 2012 - XML Index Strategies
Marco Gralike
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 2Marco Gralike
 
XFILES, The APEX 4 version - The truth is in there
XFILES, The APEX 4 version - The truth is in thereXFILES, The APEX 4 version - The truth is in there
XFILES, The APEX 4 version - The truth is in there
Marco Gralike
 
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesUKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes
Marco Gralike
 
BGOUG 2012 - Design concepts for xml applications that will perform
BGOUG 2012 - Design concepts for xml applications that will performBGOUG 2012 - Design concepts for xml applications that will perform
BGOUG 2012 - Design concepts for xml applications that will perform
Marco Gralike
 
Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2Starting with JSON Path Expressions in Oracle 12.1.0.2
Starting with JSON Path Expressions in Oracle 12.1.0.2
Marco Gralike
 
XML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDBXML In The Real World - Use Cases For Oracle XMLDB
XML In The Real World - Use Cases For Oracle XMLDB
Marco Gralike
 
UKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the DatabaseUKOUG Tech14 - Getting Started With JSON in the Database
UKOUG Tech14 - Getting Started With JSON in the Database
Marco Gralike
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Marco Gralike
 
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
XMLDB Building Blocks And Best Practices - Oracle Open World 2008 - Marco Gra...
Marco Gralike
 
Jdbc 4.0 New Features And Enhancements
Jdbc 4.0 New Features And EnhancementsJdbc 4.0 New Features And Enhancements
Jdbc 4.0 New Features And Enhancements
scacharya
 
Xml parsers
Xml parsersXml parsers
Xml parsers
Manav Prasad
 
Oracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory DatabaseOracle Database - JSON and the In-Memory Database
Oracle Database - JSON and the In-Memory Database
Marco Gralike
 
JSON in der Oracle Datenbank
JSON in der Oracle DatenbankJSON in der Oracle Datenbank
JSON in der Oracle Datenbank
Ulrike Schwinn
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
Scott Leberknight
 
wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?
Scott Leberknight
 
Object Relational Mapping in PHP
Object Relational Mapping in PHPObject Relational Mapping in PHP
Object Relational Mapping in PHP
Rob Knight
 
Database Programming
Database ProgrammingDatabase Programming
Database Programming
Henry Osborne
 

What's hot (20)

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

Similar to Miracle Open World 2011 - XML Index Strategies

advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
IreneGetzi
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
Amanda Gilmore
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)
Masaki Oshikawa
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
Lukas Vlcek
 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEX
Scott Wesley
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
David Truxall
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
Thodoris Bais
 
Spark Sql and DataFrame
Spark Sql and DataFrameSpark Sql and DataFrame
Spark Sql and DataFrame
Prashant Gupta
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
careerPointBasti
 
Import web resources using R Studio
Import web resources using R StudioImport web resources using R Studio
Import web resources using R Studio
Rupak Roy
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
EmilyJiang23
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
Eric Nelson
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?ukdpe
 
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
NoSQLmatters
 
Xml sasidhar
Xml  sasidharXml  sasidhar
Xml sasidhar
Sasidhar Kothuru
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
Thodoris Bais
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
Databricks
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
rostislav
 
Lightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and CassandraLightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and Cassandra
Rustam Aliyev
 

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

advDBMS_XML.pptx
advDBMS_XML.pptxadvDBMS_XML.pptx
advDBMS_XML.pptx
 
PostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL SuperpowersPostgreSQL's Secret NoSQL Superpowers
PostgreSQL's Secret NoSQL Superpowers
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEX
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
 
Spark Sql and DataFrame
Spark Sql and DataFrameSpark Sql and DataFrame
Spark Sql and DataFrame
 
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).pptDATA INTEGRATION (Gaining Access to Diverse Data).ppt
DATA INTEGRATION (Gaining Access to Diverse Data).ppt
 
Import web resources using R Studio
Import web resources using R StudioImport web resources using R Studio
Import web resources using R Studio
 
JakartaData-JCon.pptx
JakartaData-JCon.pptxJakartaData-JCon.pptx
JakartaData-JCon.pptx
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?
 
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
Simon Elliston Ball – When to NoSQL and When to Know SQL - NoSQL matters Barc...
 
Xml sasidhar
Xml  sasidharXml  sasidhar
Xml sasidhar
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
 
Spark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark MeetupSpark SQL Deep Dive @ Melbourne Spark Meetup
Spark SQL Deep Dive @ Melbourne Spark Meetup
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
 
Lightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and CassandraLightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and Cassandra
 
Xml
XmlXml
Xml
 

More from Marco Gralike

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

More from Marco Gralike (13)

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

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 

Miracle Open World 2011 - XML Index Strategies

  • 1. XML Indexing StrategiesChoosing the Right Index for the Right Job Marco Gralike
  • 2. Strange Chainsaw Tree Guy OakTable Member ACE Director Customer Advisory Board Member 17+ years DBA, etc. Blog.gralike.com Technology.amis.nl
  • 3. Richard Foote (Mr. Index) OakTable Member ACE Director Oracle Certified Professional 22+ years DBA, etc. RichardFoote.wordpress.com
  • 5. Structured or Semi-Structured or… Structured Semi Structured
  • 7. Document Driven / Data Driven
  • 8. Design: Width and Height and … 1 3 4 5 2 X Y 6 Z Content Height: minOccurs="0" maxOccurs=“unbounded” Content Width: type="xs:string“, restriction…? Content Distribution: histogram, statistics, skew, cardinality ?
  • 9. XMLType “Under the Hood” DOM Tree Model XQuery SQL/XML XMLType Abstraction Procedural XQuery DB XQuery XVM (use “no query rewrite”) XQuery Rewrite Pushdown SQL Execution XMLIndex Streaming XPath Evaluation RelationalAccess Methods Binary XML Object-Relational Relational Storage Secure Files Source OOW 2010 presentation S317428: Building Really Scalable XML Applications with Oracle XML DB and Oracle Text
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. XML Storage/Index Use Cases Binary XML (Schema based) XMLIndex Structured Component
  • 17. XMLType In Memory (document) CLOB (document) Object Relational (data) Binary XML (data)
  • 18. XMLType Storage Models CLOB Default until 11.2.0.2.0 Non-Schema Based Binary XML Oracle 11 and Onwards Schema and Non-Schema Based Object Relational (+Hybrid) Nested Tables, Types, Varray’s Schema Based
  • 19. Storage Index Defaults (xmltype) Binary XML / CLOB LOB Index Object Relational DBMS_XMLSCHEMA  “OPTIONS” Oracle 10g: Index Organized Tables Oracle 11g: B-Tree Indexes xdb:annotations Storage type xdb:SQLType Storage Typexdb:ColumnProps / xdb:TableProps
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. Function-Based Index Deprecated in 11.2 Object 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 Data Ordered Collection Tables (OCT) ComplexTypes… “dot” notation using the “xmldata” pseudocolumn SQL> CREATE INDEX dot_notation_index ON xml_data_table ("XMLDATA". "TEXTID");
  • 26. Syntax Index Alternatives SQL> 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 Index Unstructured Data in XML CLOB storage XML part in Object Relational XML Secondary index on XMLIndex Can only index XML data TEXT nodes Result Set Interface (new in 11.2.0.2) Specify Query request and hit list requirements in XML SQL> CREATE INDEX oracle_text_index ON xml_data_table (OBJECT_VALUE) INDEXTYPE IS CTXSYS.CONTEXT;
  • 28. Index Methods (11.1) BTree Index BTree I BT bookstore Secondary Oracle Text Index Function based Index (XPath) book whitepaper Unstructured XMLIndex title author author chapter title author id paragraph content content
  • 29. XML Document contains: Semi Structured Data and Structured Data Supports searching and fragment extraction When XPath queried is not known beforehand XMLType CLOB or Binary XML content If you use an XMLIndex and/or combine it with Structured XMLIndex(es) Usage: Unstructured XMLIndex
  • 30. Simple: Unstructured XMLIndex SQL> 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 XMLIndex CREATEINDEXXMLIDX ON XMLBINARY_TAB (object_value) INDEXTYPEISXDB.XMLIndex PARAMETERS ('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.
  • 33.
  • 35. Full Blown XMLIndex canbe BIG
  • 43. Index Methods (11.2) BTree Index BTree I BT bookstore Secondary Oracle Text Index Function based Index (XPath) book whitepaper Structured XMLIndex Unstructured XMLIndex title author author chapter title author id paragraph content content Highly Structured Islands of Data
  • 44. With highly Structured Data Likely candidates: ComplexTypes Structured Islands of Data Can be nested, but officially only one level XMLTABLE “virtual” nested column hint Will create (multiple) “Content Tables” Multiple XPath defined same columns with different purpose They deliver relational performance…! Usage: Structured XMLIndex
  • 45. Simple: Structured XMLIndex “XMLTABLE” Driven Syntax SQL> CREATE INDEX xmlindex_sxi on xml_data_table (xmlcol) indextype is xdb.xmlindex parameters ('GROUP employee_info_group XMLTABLEEMP_CONTENT_TABLE ' '/employees/emp' ' COLUMNS empidNUMBER(10) PATH ' 'id' ' '); Be aware ' '
  • 46.
  • 48.
  • 49. NON Unique BTREE IndexYour Columns RID rowid YOUR column X Key RAW Not null RID rowid Key RAW Not null YOUR columns X CONTENT TABLE(s) YOUR columns X RID rowid Key RAW Not null
  • 50. Structured XMLIndex (SXI) Content Table(s) BasedonXMLTABLEsyntax XMLTable construct canbenestedbut: “Only ONE XMLType column allowed”  VIRTUAL column CanbemaintainedManually Secondairyindexespossible LOCAL parameter (partitioning) Structured XMLIndex f (x) Content Tables
  • 51. Adding Structured Indexes SQL> ALTER INDEX xmlindex_sxi parameters ('ADD_GROUP GROUP my_new_group XMLTABLE xml_content_tab_new ' '/root/extra' ' COLUMNS extracol VARCHAR2(35) PATH ' 'new_element' ' ');
  • 52. Mixed XMLIndex Options bookstore Secondary (text)Index Unstructured XMLIndex book whitepaper Structured XMLIndex Structured XMLIndex title author author paragraph title author id chapter content content
  • 53. Mixed XMLIndex structures CREATE INDEX xmlindex on TEST_RANGE_XML (doc) indextype is xdb.xmlindex PARAMETERS (' PATH TABLE path_table PATHS (EXCLUDE(/root/ElementInfo)) '); BEGIN DBMS_XMLINDEX.registerParameter ('StructuredXML', 'ADD_GROUP GROUP ElementInfo XMLTABLExml_cnttable_valueinfo ' '/root/ElementInfo' ' COLUMNS ValueInfo VARCHAR2(100) PATH ' 'ValueInfo' '); END; / ALTER INDEX xmlindex PARAMETERS('PARAM StructuredXML');
  • 54. XMLIndex Maintenance ALTER INDEX XMLIndex Parameter Changes DBMS_XMLINDEX.DROPPARAMETER DBMS_XMLINDEX.MODIFYPARAMETER DBMS_XMLINDEX.REGISTERPARAMETER Manual Synchronizing an XMLIndex DBMS_XMLINDEX.SYNCINDEX Pending Tables
  • 55. “There Can Be Only One…”
  • 56. Syntax Awareness SYNC=ALWAYS Mandatory when Combined XMLIndex SYNC=MANUAL Locking STALE=FALSE | TRUE Hmmm… Empty XMLIndex tables OOPS  I got my “XMLTABLE” Syntax etc. “wrong”
  • 57. Notes on XMLIndex (1) Only ONE XMLIndex is allowed in a user schema Add extra XMLIndex structures (structured or unstructured) via ADD_GROUP syntax Only 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 XMLIndexes An XMLIndex on a HASH partitioned XMLType column or XMLType table, isnot (yet) allowed But you can create an Oracle Text Index on such structures
  • 59. Recap True understanding of Storage and Index options will provide: Optimal performance Out perform XML (Java based) A lot of choice: Problems are Complex Also provides Solutions Good design beforehand is the path to success
  • 60. References (1) Oracle Whitepapers Oracle 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) Blog http://blog.gralike.com (Dedicated XMLDB blog) Semi-Structured XMLIndex section Structured XMLIndex section
  • 61. References (2) Oracle Open World Presentationon XML DB S317428: Building Really Scalable XML Applications with Oracle XML DB and Oracle Text XML DB OTN / FAQ Thread http://forums.oracle.com/forums/forum.jspa?forumID=34 http://forums.oracle.com/forums/thread.jspa?threadID=410714

Editor's Notes

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