SlideShare una empresa de Scribd logo
1 de 60
Marco Gralike
Management Consultant 
• Ordina, The Netherlands 
• Oracle 20+ years experience 
• Oracle ACE Director (www.xmldb.nl)
What do we use in the 
database…
VARCHAR NVARCHAR NUMBER INTEGER FLOAT DECIMAL CHAR VARCHAR2 
NVARCHAR2 NCHAR VARYING VARCHAR DATE REAL DOUBLE PRECISION 
UNSIGNED BINARY INTEGER(8) UNSIGNED BINARY INTEGER(16) UNSIGNED 
BINARY INTEGER(32)SIGNED BINARY INTEGER(8)SIGNED BINARY 
INTEGER(16)SIGNED BINARY INTEGER(32)POINTER BINARY ROWID RAW CHAR 
BINARY_FLOAT BINARY FLOAT BINARY DOUBLE LONG RAW LONG UB2 LONG 
SB4 MLSLABEL XMLTYPE (TABLE or REF) BINARY_DOUBLE PL/SQL REF 
CURSOR UROWID KOKED1 KOTTBX KOTTB KOTMI KOTMD KOTADX KOTAD KOTTD 
KOKED REF CLOB BLOB BFILE TYPE (USER-DEFINED) TYPE (TABLE OF 
RECORD) TYPE (VARRAY) CFILE TIME TIME WITH TZ TIMESTAMP TIMESTAMP 
WITH TZ INTERVAL YEAR TO MONTH INTERVAL DAY TO SECOND NAMED 
COLLECTION NAMED OBJECT TIMESTAMP WITH LOCAL TZ OCTET SMALLINT 
VARYING ARRAY TABLE PL/SQL RECORD PL/SQL COLLECTION PL/SQL 
BOOLEAN OID CONTIGUOUS ARRAY CANONICALLOB POINTER PL/SQL POSITIVE 
PL/SQL POSITIVEN PL/SQL ROWID PL/SQL LONG PL/SQL LONG RAW PL/SQL 
BINARY INTEGER PL/SQL PLS INTEGER PL/SQL NATURAL PL/SQL NATURALN 
PL/SQL STRING...
Datatype moto: 
If incorrect datatype you will have a decrease in performance or 
you get the incorrect results ( if you are lucky 8))...
*) The In-Memory Maria Option
What can we do in XMLType 
land… (fast recap / intro)
Unstructured 
XMLIndex 
Structured 
XMLIndex 
Structured 
XMLIndex 
XML Text Index 
paragraph 
book 
title author author 
whitepaper 
title author id 
content 
bookstore 
chapter 
content
Unstructured 
XMLIndex 
f (x) 
Path Table
Structured 
XMLIndex 
f (x) 
Content 
Tables
CREATE INDEX LINEITEMS_XI 
ON PURCHASEORDER_T_BIN (XML_COLUMN) 
INDEXTYPE IS "XDB"."XMLINDEX" 
PARAMETERS (' GROUP LINEITEMS_GROUP 
XMLTABLE LINEITEM_SXI_T 
(inmemory memcompress for query priority critical) 
''/PurchaseOrder/LineItems/LineItem'' 
COLUMNS 
lineitem VARCHAR2(30) PATH ''@ItemNumber'', 
description VARCHAR2(100) PATH ''Part/@Description'', 
partid VARCHAR2(30) PATH ''Part'', 
unitprice VARCHAR2(30) PATH ''Part/@UnitPrice'', 
quantity VARCHAR2(30) PATH ''Quantity'' 
');
Unstructured 
XMLIndex 
Structured 
XMLIndex 
Structured 
XMLIndex 
XML Text Index 
paragraph 
book 
title author author 
whitepaper 
title author id 
content 
bookstore 
chapter 
content
Parallelization 
XMLType  12.1
Setup
10.000 
45263
In Memory / XML Storage Tests 
 CLOB – Securefile 
 XMLType – Securefile Binary XML 
 XMLType – Securefile Binary XML (XSD) 
 XMLType – Object Relational (XSD – Default) 
 XMLType – Object Relational (XSD – Out of line XML)
SQL> alter table PURCHASEORDER_T 
inmemory memcompress for query priority critical; 
SQL> alter table LINEITEMS_T 
inmemory memcompress for query priority critical; 
SQL> create TABLE... 
inmemory memcompress for query priority critical; 
SQL> create INDEX ... INDEXTYPE IS "XDB"."XMLINDEX" 
inmemory memcompress for query priority critical;
In Memory / XML Index Tests 
 Securefile Binary XML - In Memory Structured Index 
 Securefile Binary XML (XSD) – In Memory Structured Index 
 Object Relational (XSD – Default) 
 Object Relational (XSD – Out of line XML)
In Memory / XML Query’s 
“Arbitrary queries” 
 Query 1 - Touching PurchaseOrder and LineItems 
 Query 2 - Touching PurchaseOrder and LineItems & group/count 
 Query 3 - Touching LineItems elements and attributes only
Findings & Graphics…
SQL> SELECT * 
FROM XMLTABLE 
('for $i in fn:collection("oradb:/IM/PURCHASEORDER_T”) 
/PurchaseOrder[ CostCenter = $CC 
and Requestor = $REQUESTOR 
and count(LineItems/LineItem) > $QUANTITY 
]/Reference 
RETURN $i 
' 
passing 'A60' as "CC" 
, 'Diana Lorentz' as "REQUESTOR" 
, 5 as "QUANTITY" 
);
COLUMN_VALUE 
------------------------------------------------------- 
<Reference>DLORENTZ-20120411133920295PDT</Reference> 
<Reference>DLORENTZ-20120206180918983PST</Reference> 
<Reference>DLORENTZ-20121219144418724PST</Reference> 
<Reference>DLORENTZ-20120710194550792PDT</Reference> 
<Reference>DLORENTZ-20120723165626922PDT</Reference> 
<Reference>DLORENTZ-20120728151113368PDT</Reference> 
<Reference>DLORENTZ-20120602200119333PDT</Reference> 
<Reference>DLORENTZ-20120513165042874PDT</Reference> 
... 
...
varray, nested table (default)
out of line
*) Unoptimized XML construct 
detected 
(enable XMLOptimizationCheck for 
more information)
*) Collection Iterator Pickler Fetch 
XMLSEQUENCEFROMXMLTYPE 
XQSEQUENCEFROMXMLTYPE
*) Tracing ORA-19022 
SET XMLOptimizationCheck ON 
Event = “19027 trace name context forever, level 0x2000” 
Event = “10053 trace name context forever, level 1”
SQL> SELECT t1.Country 
, t2.Part 
, min(t2.Quantity) as quantity 
, count(*) as occurrence 
FROM PURCHASEORDER_T_X pt 
, XMLTABLE('/PurchaseOrder' 
PASSING pt.{xmltype} 
COLUMNS 
Country PATH 'ShippingInstructions/Address/country', 
x_lineitems XMLTYPE PATH 'LineItems/LineItem' ) t1 
, XMLTABLE(’*' 
PASSING t1.x_lineitems 
COLUMNS 
Part PATH 'Part', 
Quantity PATH 'Quantity' ) t2 
WHERE t1.Country is NOT NULL 
AND t1.Country = 'United Kingdom' 
HAVING count(*) >= 10 
GROUP BY t1.Country, t2.Part 
ORDER BY t1.Country;
COUNTRY PART QUANTITY OCCURRENCE 
--------------- ------------ -------- ---------- 
United Kingdom 56775022792 1 11 
United Kingdom 43396799493 1 10 
United Kingdom 717951000866 1 10 
United Kingdom 13023046696 1 11 
United Kingdom 25192024825 1 10 
5 rows selected.
SQL> SELECT lines.lineitem, 
lines.description, 
lines.partid, 
lines.unitprice, 
lines.quantity 
FROM purchaseorder_t pt, 
XMLTable('/PurchaseOrder/LineItems/LineItem' 
PASSING xmltype_table_or_column 
COLUMNS 
lineitem PATH '@ItemNumber', 
description PATH 'Part/@Description', 
partid PATH 'Part', 
unitprice PATH 'Part/@UnitPrice', 
quantity PATH 'Quantity’ 
) lines;
LINEITEM DESCRIPTION PARTID UNITPRICE QTY 
-------- ------------------------------------------ ----------- --------- --- 
2 The Longest Yard 97360870848 27,95 5 
1 Babe / Babe- Pig In the City 25192141621 19,95 4 
3 Down to You 71795100742 19,95 3 
2 I Spy: Tag, You're It 14381983920 19,95 4 
4 Dragon Fist 43396071711 19,95 3 
1 Multiplicity 43396824492 19,95 9 
4 Things You Can Tell Just By Looking At Her 27616859198 19,95 3 
... 
... 
45263 rows selected
SQL> SELECT lines.lineitem, 
lines.description, 
lines.partid, 
lines.unitprice, 
lines.quantity 
FROM purchaseorder_t pt, 
XMLTable('/PurchaseOrder/LineItems/LineItem' 
PASSING xmltype_table_or_column 
COLUMNS 
LINES_RNO FOR ORDINALITY, 
lineitem PATH '@ItemNumber', 
description PATH 'Part/@Description', 
partid PATH 'Part', 
unitprice PATH 'Part/@UnitPrice', 
quantity PATH 'Quantity’ 
) lines;
Recap…
• In-Memory Column Store can achieve extra performance 
• In-Memory Column Store can be applied selectively (column) 
• Optimization possible – “RID” (for ordinality) 
• Optimizer XML Costs not yet on par (costs <> timings) 
• “Old rules-of-thumb” for XMLType still apply

Más contenido relacionado

La actualidad más candente

OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
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 2
Marco Gralike
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Faysal Shaarani (MBA)
 

La actualidad más candente (20)

BGOUG 2012 - XML Index Strategies
BGOUG 2012 - XML Index StrategiesBGOUG 2012 - XML Index Strategies
BGOUG 2012 - XML Index Strategies
 
Hotsos 2013 - Creating Structure in Unstructured Data
Hotsos 2013 - Creating Structure in Unstructured DataHotsos 2013 - Creating Structure in Unstructured Data
Hotsos 2013 - Creating Structure in Unstructured Data
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
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
 
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
 
XML Amsterdam - Creating structure in unstructured data
XML Amsterdam - Creating structure in unstructured dataXML Amsterdam - Creating structure in unstructured data
XML Amsterdam - Creating structure in unstructured data
 
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
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)
 
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
 
Polyglot Persistence
Polyglot PersistencePolyglot Persistence
Polyglot Persistence
 
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...
 
Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0Cloudera Impala, updated for v1.0
Cloudera Impala, updated for v1.0
 
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
XmlXml
Xml
 
whats New in axapta 2012
whats New in axapta 2012whats New in axapta 2012
whats New in axapta 2012
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Json in 18c and 19c
Json in 18c and 19cJson in 18c and 19c
Json in 18c and 19c
 
Object Relational Mapping in PHP
Object Relational Mapping in PHPObject Relational Mapping in PHP
Object Relational Mapping in PHP
 
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
Load & Unload Data TO and FROM Snowflake (By Faysal Shaarani)
 
wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?wtf is in Java/JDK/wtf7?
wtf is in Java/JDK/wtf7?
 

Similar a UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes

Java Data Migration with Data Pipeline
Java Data Migration with Data PipelineJava Data Migration with Data Pipeline
Java Data Migration with Data Pipeline
North Concepts
 

Similar a UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes (20)

Working With XML in IDS Applications
Working With XML in IDS ApplicationsWorking With XML in IDS Applications
Working With XML in IDS Applications
 
MariaDB ColumnStore
MariaDB ColumnStoreMariaDB ColumnStore
MariaDB ColumnStore
 
Query optimizer vivek sharma
Query optimizer vivek sharmaQuery optimizer vivek sharma
Query optimizer vivek sharma
 
Dbms &amp; oracle
Dbms &amp; oracleDbms &amp; oracle
Dbms &amp; oracle
 
Postgres Performance for Humans
Postgres Performance for HumansPostgres Performance for Humans
Postgres Performance for Humans
 
Java Data Migration with Data Pipeline
Java Data Migration with Data PipelineJava Data Migration with Data Pipeline
Java Data Migration with Data Pipeline
 
PO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - SqlPO WER - Piotr Mariat - Sql
PO WER - Piotr Mariat - Sql
 
Bcp
BcpBcp
Bcp
 
Sql
SqlSql
Sql
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra
 
A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data Comedy
 
Rdbms day3
Rdbms day3Rdbms day3
Rdbms day3
 
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
23 October 2013 - AWS 201 - A Walk through the AWS Cloud: Introduction to Ama...
 
Big Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStoreBig Data Analytics with MariaDB ColumnStore
Big Data Analytics with MariaDB ColumnStore
 
A few things about the Oracle optimizer - 2013
A few things about the Oracle optimizer - 2013A few things about the Oracle optimizer - 2013
A few things about the Oracle optimizer - 2013
 
Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02Lecture05sql 110406195130-phpapp02
Lecture05sql 110406195130-phpapp02
 
03 2017Emea_RoadshowMilan-WhatsNew-Mariadbserver10_2andmaxscale 2_1
03 2017Emea_RoadshowMilan-WhatsNew-Mariadbserver10_2andmaxscale 2_103 2017Emea_RoadshowMilan-WhatsNew-Mariadbserver10_2andmaxscale 2_1
03 2017Emea_RoadshowMilan-WhatsNew-Mariadbserver10_2andmaxscale 2_1
 
hive HBase Metastore - Improving Hive with a Big Data Metadata Storage
hive HBase Metastore - Improving Hive with a Big Data Metadata Storagehive HBase Metastore - Improving Hive with a Big Data Metadata Storage
hive HBase Metastore - Improving Hive with a Big Data Metadata Storage
 
Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.Distributed Queries in IDS: New features.
Distributed Queries in IDS: New features.
 
How to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analyticsHow to use Parquet as a basis for ETL and analytics
How to use Parquet as a basis for ETL and analytics
 

Más de 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
 
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
Marco Gralike
 

Más de Marco Gralike (15)

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
 
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
 
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File ServerUKOUG 2011 - Drag, Drop and other Stuff. Using your Database as a File Server
UKOUG 2011 - 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
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

UKOUG Tech14 - Using Database In-Memory Column Store with Complex Datatypes

  • 2. Management Consultant • Ordina, The Netherlands • Oracle 20+ years experience • Oracle ACE Director (www.xmldb.nl)
  • 3. What do we use in the database…
  • 4. VARCHAR NVARCHAR NUMBER INTEGER FLOAT DECIMAL CHAR VARCHAR2 NVARCHAR2 NCHAR VARYING VARCHAR DATE REAL DOUBLE PRECISION UNSIGNED BINARY INTEGER(8) UNSIGNED BINARY INTEGER(16) UNSIGNED BINARY INTEGER(32)SIGNED BINARY INTEGER(8)SIGNED BINARY INTEGER(16)SIGNED BINARY INTEGER(32)POINTER BINARY ROWID RAW CHAR BINARY_FLOAT BINARY FLOAT BINARY DOUBLE LONG RAW LONG UB2 LONG SB4 MLSLABEL XMLTYPE (TABLE or REF) BINARY_DOUBLE PL/SQL REF CURSOR UROWID KOKED1 KOTTBX KOTTB KOTMI KOTMD KOTADX KOTAD KOTTD KOKED REF CLOB BLOB BFILE TYPE (USER-DEFINED) TYPE (TABLE OF RECORD) TYPE (VARRAY) CFILE TIME TIME WITH TZ TIMESTAMP TIMESTAMP WITH TZ INTERVAL YEAR TO MONTH INTERVAL DAY TO SECOND NAMED COLLECTION NAMED OBJECT TIMESTAMP WITH LOCAL TZ OCTET SMALLINT VARYING ARRAY TABLE PL/SQL RECORD PL/SQL COLLECTION PL/SQL BOOLEAN OID CONTIGUOUS ARRAY CANONICALLOB POINTER PL/SQL POSITIVE PL/SQL POSITIVEN PL/SQL ROWID PL/SQL LONG PL/SQL LONG RAW PL/SQL BINARY INTEGER PL/SQL PLS INTEGER PL/SQL NATURAL PL/SQL NATURALN PL/SQL STRING...
  • 5. Datatype moto: If incorrect datatype you will have a decrease in performance or you get the incorrect results ( if you are lucky 8))...
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. *) The In-Memory Maria Option
  • 12. What can we do in XMLType land… (fast recap / intro)
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Unstructured XMLIndex Structured XMLIndex Structured XMLIndex XML Text Index paragraph book title author author whitepaper title author id content bookstore chapter content
  • 18. Unstructured XMLIndex f (x) Path Table
  • 19.
  • 20.
  • 21. Structured XMLIndex f (x) Content Tables
  • 22.
  • 23. CREATE INDEX LINEITEMS_XI ON PURCHASEORDER_T_BIN (XML_COLUMN) INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS (' GROUP LINEITEMS_GROUP XMLTABLE LINEITEM_SXI_T (inmemory memcompress for query priority critical) ''/PurchaseOrder/LineItems/LineItem'' COLUMNS lineitem VARCHAR2(30) PATH ''@ItemNumber'', description VARCHAR2(100) PATH ''Part/@Description'', partid VARCHAR2(30) PATH ''Part'', unitprice VARCHAR2(30) PATH ''Part/@UnitPrice'', quantity VARCHAR2(30) PATH ''Quantity'' ');
  • 24. Unstructured XMLIndex Structured XMLIndex Structured XMLIndex XML Text Index paragraph book title author author whitepaper title author id content bookstore chapter content
  • 26. Setup
  • 27.
  • 29. In Memory / XML Storage Tests  CLOB – Securefile  XMLType – Securefile Binary XML  XMLType – Securefile Binary XML (XSD)  XMLType – Object Relational (XSD – Default)  XMLType – Object Relational (XSD – Out of line XML)
  • 30. SQL> alter table PURCHASEORDER_T inmemory memcompress for query priority critical; SQL> alter table LINEITEMS_T inmemory memcompress for query priority critical; SQL> create TABLE... inmemory memcompress for query priority critical; SQL> create INDEX ... INDEXTYPE IS "XDB"."XMLINDEX" inmemory memcompress for query priority critical;
  • 31. In Memory / XML Index Tests  Securefile Binary XML - In Memory Structured Index  Securefile Binary XML (XSD) – In Memory Structured Index  Object Relational (XSD – Default)  Object Relational (XSD – Out of line XML)
  • 32. In Memory / XML Query’s “Arbitrary queries”  Query 1 - Touching PurchaseOrder and LineItems  Query 2 - Touching PurchaseOrder and LineItems & group/count  Query 3 - Touching LineItems elements and attributes only
  • 34.
  • 35. SQL> SELECT * FROM XMLTABLE ('for $i in fn:collection("oradb:/IM/PURCHASEORDER_T”) /PurchaseOrder[ CostCenter = $CC and Requestor = $REQUESTOR and count(LineItems/LineItem) > $QUANTITY ]/Reference RETURN $i ' passing 'A60' as "CC" , 'Diana Lorentz' as "REQUESTOR" , 5 as "QUANTITY" );
  • 36. COLUMN_VALUE ------------------------------------------------------- <Reference>DLORENTZ-20120411133920295PDT</Reference> <Reference>DLORENTZ-20120206180918983PST</Reference> <Reference>DLORENTZ-20121219144418724PST</Reference> <Reference>DLORENTZ-20120710194550792PDT</Reference> <Reference>DLORENTZ-20120723165626922PDT</Reference> <Reference>DLORENTZ-20120728151113368PDT</Reference> <Reference>DLORENTZ-20120602200119333PDT</Reference> <Reference>DLORENTZ-20120513165042874PDT</Reference> ... ...
  • 37. varray, nested table (default)
  • 38.
  • 40. *) Unoptimized XML construct detected (enable XMLOptimizationCheck for more information)
  • 41. *) Collection Iterator Pickler Fetch XMLSEQUENCEFROMXMLTYPE XQSEQUENCEFROMXMLTYPE
  • 42. *) Tracing ORA-19022 SET XMLOptimizationCheck ON Event = “19027 trace name context forever, level 0x2000” Event = “10053 trace name context forever, level 1”
  • 43.
  • 44. SQL> SELECT t1.Country , t2.Part , min(t2.Quantity) as quantity , count(*) as occurrence FROM PURCHASEORDER_T_X pt , XMLTABLE('/PurchaseOrder' PASSING pt.{xmltype} COLUMNS Country PATH 'ShippingInstructions/Address/country', x_lineitems XMLTYPE PATH 'LineItems/LineItem' ) t1 , XMLTABLE(’*' PASSING t1.x_lineitems COLUMNS Part PATH 'Part', Quantity PATH 'Quantity' ) t2 WHERE t1.Country is NOT NULL AND t1.Country = 'United Kingdom' HAVING count(*) >= 10 GROUP BY t1.Country, t2.Part ORDER BY t1.Country;
  • 45. COUNTRY PART QUANTITY OCCURRENCE --------------- ------------ -------- ---------- United Kingdom 56775022792 1 11 United Kingdom 43396799493 1 10 United Kingdom 717951000866 1 10 United Kingdom 13023046696 1 11 United Kingdom 25192024825 1 10 5 rows selected.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51. SQL> SELECT lines.lineitem, lines.description, lines.partid, lines.unitprice, lines.quantity FROM purchaseorder_t pt, XMLTable('/PurchaseOrder/LineItems/LineItem' PASSING xmltype_table_or_column COLUMNS lineitem PATH '@ItemNumber', description PATH 'Part/@Description', partid PATH 'Part', unitprice PATH 'Part/@UnitPrice', quantity PATH 'Quantity’ ) lines;
  • 52. LINEITEM DESCRIPTION PARTID UNITPRICE QTY -------- ------------------------------------------ ----------- --------- --- 2 The Longest Yard 97360870848 27,95 5 1 Babe / Babe- Pig In the City 25192141621 19,95 4 3 Down to You 71795100742 19,95 3 2 I Spy: Tag, You're It 14381983920 19,95 4 4 Dragon Fist 43396071711 19,95 3 1 Multiplicity 43396824492 19,95 9 4 Things You Can Tell Just By Looking At Her 27616859198 19,95 3 ... ... 45263 rows selected
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. SQL> SELECT lines.lineitem, lines.description, lines.partid, lines.unitprice, lines.quantity FROM purchaseorder_t pt, XMLTable('/PurchaseOrder/LineItems/LineItem' PASSING xmltype_table_or_column COLUMNS LINES_RNO FOR ORDINALITY, lineitem PATH '@ItemNumber', description PATH 'Part/@Description', partid PATH 'Part', unitprice PATH 'Part/@UnitPrice', quantity PATH 'Quantity’ ) lines;
  • 58.
  • 60. • In-Memory Column Store can achieve extra performance • In-Memory Column Store can be applied selectively (column) • Optimization possible – “RID” (for ordinality) • Optimizer XML Costs not yet on par (costs <> timings) • “Old rules-of-thumb” for XMLType still apply