Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of the 12.1.0.2 In-Memory Column Store option with XMLType data type storage options common to the Oracle 12.1 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))...
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
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
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
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.
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
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