SlideShare a Scribd company logo
Efficiently Publishing Relational Data as XML Documents Authors:-  J Shanmugasundaram, Michael Carey etc (IBM Almaden Research Center) Presented By Harshavardhan Achrekar (University of Massachusetts-Lowell)
What drove them? XML emerging as standard for business data exchange on World Wide Web. Need a mechanism to publish currently stored relational data as XML Documents.
Primary Issues Language Specifications - structure and tag data from tables as hierarchical XML Documents. Best Implementation Technique – study characteristics and performances of various alternatives for constructing XML documents. When to add tags & structure How much of processing is done within relational engine?
RoadMap Language specification based on SQL Implementation Early tagging, structuring Late tagging, structuring Early structure, late tagging Performance Evaluation
Sample XML Document for Customer <customer id=”C1”> <name> John Doe </name> <accounts> <account id=”A1”> 1894654 </account> <account id=”A2”> 3849342 </account> </accounts> <porders> <porder id=”PO1” acct=”A1”>  // first purchase order <date>1 Jan 2000</date> <items> <item id=”I1”> Shoes </item> <item id=”I2”> Bungee Ropes </item> </items> <payments> <payment id=”P1”> due Jan 15 </payment> <payment id=”P2”> due Jan 20 </payment> <payment id=”P3”> due feb 15 </payment> </payments> </porder> <porder id=”PO2” acct=”A2”>  // second purchase order … </porder> </porders> </customer> Note the Elements Names/Tags ID Refs Attribute Nested sub-element
Underlying tables Customer ( id  int,  name  varchar) Account ( id  varchar,  custID  int,  acctnum  int) Item ( id  int, poID  int, desc  varchar) PurchOrder ( id  int, custID  int, acctID  varchar, date  varchar) Payment ( id  int, poID  int, desc  varchar)
SQL-based language specifications Sqlfunctions:  Define XMLConstruct  CUST (Custid: integer, CustName: varchar)  AS  { <Customer id=$Custid>$CustName </Customer>} Sqlaggregates:  Select  XMLAGG  (   ITEM  (item.id, item.desc) ) From   Item item // returns an XML aggregation of items
Customer Definition of XML Constructor Define XML Constructor  CUST  (custId: integer, custName: varchar(20), acctList: xml, porderList: xml) AS { < customer  id=$custId> < name > $custName </ name > < accounts > $acctList </ accounts > < porders > $porderList </ porders > </ customer > } Input Output Output - A Customer XML Element Aggregate function XMLAGG – Concatenates XML Fragments produced by XML Constructor
Sample SQL query  constructs XML from relational tables Select cust.name, CUST(cust.id, cust.name, (Select XMLAGG(ACCT(acct.id, acct.acctnum)) From Account acct  Where acct.custId=cust.id), (Select XMLAGG(PORDER(porder.id, porder.acct, porder.date, (Select XMLAGG(ITEM(item.id, item.desc)) From Item item  Where item.poid=porder.id) (Select XMLAGG(PAYMENT(pay.id,pay.desc)) From Payment pay, Where pay.poid=porder.id))) From PurchOrder porder  Where porder.custID=cust.id)) From Customer cust   Correlated sub-query for customer’s Accounts Correlated sub-query For purchase orders Top Level query returns each customer from customer table Correlated sub-query returns XML fragment LINES  1-14 produces Scalar function returning Customer XML
Implementation Alternatives Two main differences: Nesting (structuring) Tagging Space of alternatives: Late Tagging Early Tagging Late Structuring Early Structuring Inside Engine Inside Engine Inside Engine Outside Engine Outside Engine Outside Engine Stored Procedures CLOB
Early tagging and structuring Stored Procedure - Outside the engine Approach  Explicitly issue nested queries Algorithm:- First query & retrieve root elements (customers id, name) Using Customer id ,issue a query to retrieve account info. Next, for same customer id, issue a query to retrieve customers purchase order For each purchase order retrieved, query to get item and payment info. Once done Processing of one customer is over. Repeat same for next customer till entire XML Document is ready. Fixed order Nested Loop Join outside the ENGINE Tag/Structure as soon as structure is ready Many SQL queries issued/tuple for tables with nested structure.
Early tagging and structuring Correlated CLOB - Inside the engine Approach   Push queries  into  the engine Plug in  XMLAGG, XMLCONSTRUCT   support into engine Character Large Objects- CLOBS XML Fragments Performance Issues -handle huge CLOBS in engine Fixed join order – implies nested loop join strategy
Efficiently Publishing Relational Data as XML Documents
Early tagging and structuring De-Correlated CLOB - Inside the engine Approach\ Decorrelate and use Outer Joins – no longer fixed order Compute Account lists associated with all customers Compute Purchase order lists associated with all customers Join results above on customer id. Still carry around CLOBs  (due to early tagging!)
Efficiently Publishing Relational Data as XML Documents

More Related Content

Viewers also liked (20)

PPTX
Livelihood improvment through degraded forest management nepal koirala_pashupati
Ministry of Forests and Soil Conservation
 
PDF
GallupReport
Samir El-Nabawy
 
PPT
Pc14 junior primary brief intro nov 2013 mb
fknights
 
KEY
Succesvol content management
Sterc Internet & Marketing
 
PDF
Inferno opera in Musica - rassegna stampa giugno 2011
Simona Vacchieri
 
PPSX
Windows 8
Open Academy
 
PPT
"Кликай умно,кликай безопасно!"
Оксана Алексеева
 
PPTX
DCM Presentation Multitasking and conncted devices
Pietro Lambert
 
PDF
Naplózás a gyakorlatban
Open Academy
 
PDF
Eca elder-care-asia
Medical Events
 
PPS
Confined spaces brief
bobrobbo
 
PPTX
Photoshop
Matthew Farber
 
PDF
Netapp Introduction to Flash Technology Infographic
Aruj Thirawat
 
DOCX
Inorme 2 trimestre 2014 biblioteca del pio x
Daniel Francisco Doffo
 
PDF
Toshiba Storage Protfolio 2014
Mustafa Kuğu
 
PDF
Staffing event engineering
Bobby Munster
 
PPT
Okostelefonok és táblagépek menedzsmentje
Open Academy
 
PDF
Disinegrated development of the built and natural environment
ruralfringe
 
PPTX
[Student exchange vietnam] Vietnamese language training
Linh MP. Pham
 
PPTX
Skoleni b3 socialni_media
Jiri Snitil
 
Livelihood improvment through degraded forest management nepal koirala_pashupati
Ministry of Forests and Soil Conservation
 
GallupReport
Samir El-Nabawy
 
Pc14 junior primary brief intro nov 2013 mb
fknights
 
Succesvol content management
Sterc Internet & Marketing
 
Inferno opera in Musica - rassegna stampa giugno 2011
Simona Vacchieri
 
Windows 8
Open Academy
 
"Кликай умно,кликай безопасно!"
Оксана Алексеева
 
DCM Presentation Multitasking and conncted devices
Pietro Lambert
 
Naplózás a gyakorlatban
Open Academy
 
Eca elder-care-asia
Medical Events
 
Confined spaces brief
bobrobbo
 
Photoshop
Matthew Farber
 
Netapp Introduction to Flash Technology Infographic
Aruj Thirawat
 
Inorme 2 trimestre 2014 biblioteca del pio x
Daniel Francisco Doffo
 
Toshiba Storage Protfolio 2014
Mustafa Kuğu
 
Staffing event engineering
Bobby Munster
 
Okostelefonok és táblagépek menedzsmentje
Open Academy
 
Disinegrated development of the built and natural environment
ruralfringe
 
[Student exchange vietnam] Vietnamese language training
Linh MP. Pham
 
Skoleni b3 socialni_media
Jiri Snitil
 

Similar to Relational data as_xml (20)

PPT
Xml
Vanndy Sun
 
PPT
10. XML in DBMS
koolkampus
 
PPT
Doctrine 2 - Introduction
Diego Lewin
 
PPT
Sql Summit Clr, Service Broker And Xml
David Truxall
 
PPT
Building Data Mapper PHP5
Vance Lucas
 
PDF
xml-150211140504-conversion-gate01 (1).pdf
ssusere05ec21
 
PPT
test
guesta8a7b8
 
PPT
6 311 W
guest471367
 
PPT
6 311 W
S Arunima
 
PPT
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
CHOOSE
 
KEY
Object Relational Mapping in PHP
Rob Knight
 
PPT
[DSBW Spring 2010] Unit 10: XML and Web And beyond
Carles Farré
 
PPTX
Agile data presentation 3 - cambridge
Romans Malinovskis
 
PPT
Xml
Abhishek Raj
 
PPTX
Database Basics
Abdel Moneim Emad
 
DOCX
How to design a database that include planning
Kamal Golan
 
PPT
Linq 090701233237 Phpapp01
google
 
PPTX
Domain oriented development
rajmundr
 
PPTX
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
Lucas Jellema
 
10. XML in DBMS
koolkampus
 
Doctrine 2 - Introduction
Diego Lewin
 
Sql Summit Clr, Service Broker And Xml
David Truxall
 
Building Data Mapper PHP5
Vance Lucas
 
xml-150211140504-conversion-gate01 (1).pdf
ssusere05ec21
 
6 311 W
guest471367
 
6 311 W
S Arunima
 
Ralf Laemmel - Not quite a sales pitch for C# 3.0 and .NET's LINQ - 2008-03-05
CHOOSE
 
Object Relational Mapping in PHP
Rob Knight
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
Carles Farré
 
Agile data presentation 3 - cambridge
Romans Malinovskis
 
Database Basics
Abdel Moneim Emad
 
How to design a database that include planning
Kamal Golan
 
Linq 090701233237 Phpapp01
google
 
Domain oriented development
rajmundr
 
The Story of How an Oracle Classic Stronghold successfully embraced SOA (ODTU...
Lucas Jellema
 
Ad

More from Harshavardhan Achrekar (7)

PDF
Twitter Improves Seasonal Influenza Prediction
Harshavardhan Achrekar
 
PPT
Massivegraph telecom ppt
Harshavardhan Achrekar
 
PPT
Web services security_in_wse_3_ppt
Harshavardhan Achrekar
 
PPT
Query optimization for_sensor_networks
Harshavardhan Achrekar
 
PPT
Measuring the happiness of large scale written expression harsh
Harshavardhan Achrekar
 
PPT
A framework of distributed indexing and data
Harshavardhan Achrekar
 
Twitter Improves Seasonal Influenza Prediction
Harshavardhan Achrekar
 
Massivegraph telecom ppt
Harshavardhan Achrekar
 
Web services security_in_wse_3_ppt
Harshavardhan Achrekar
 
Query optimization for_sensor_networks
Harshavardhan Achrekar
 
Measuring the happiness of large scale written expression harsh
Harshavardhan Achrekar
 
A framework of distributed indexing and data
Harshavardhan Achrekar
 
Ad

Recently uploaded (20)

PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 

Relational data as_xml

  • 1. Efficiently Publishing Relational Data as XML Documents Authors:- J Shanmugasundaram, Michael Carey etc (IBM Almaden Research Center) Presented By Harshavardhan Achrekar (University of Massachusetts-Lowell)
  • 2. What drove them? XML emerging as standard for business data exchange on World Wide Web. Need a mechanism to publish currently stored relational data as XML Documents.
  • 3. Primary Issues Language Specifications - structure and tag data from tables as hierarchical XML Documents. Best Implementation Technique – study characteristics and performances of various alternatives for constructing XML documents. When to add tags & structure How much of processing is done within relational engine?
  • 4. RoadMap Language specification based on SQL Implementation Early tagging, structuring Late tagging, structuring Early structure, late tagging Performance Evaluation
  • 5. Sample XML Document for Customer <customer id=”C1”> <name> John Doe </name> <accounts> <account id=”A1”> 1894654 </account> <account id=”A2”> 3849342 </account> </accounts> <porders> <porder id=”PO1” acct=”A1”> // first purchase order <date>1 Jan 2000</date> <items> <item id=”I1”> Shoes </item> <item id=”I2”> Bungee Ropes </item> </items> <payments> <payment id=”P1”> due Jan 15 </payment> <payment id=”P2”> due Jan 20 </payment> <payment id=”P3”> due feb 15 </payment> </payments> </porder> <porder id=”PO2” acct=”A2”> // second purchase order … </porder> </porders> </customer> Note the Elements Names/Tags ID Refs Attribute Nested sub-element
  • 6. Underlying tables Customer ( id int, name varchar) Account ( id varchar, custID int, acctnum int) Item ( id int, poID int, desc varchar) PurchOrder ( id int, custID int, acctID varchar, date varchar) Payment ( id int, poID int, desc varchar)
  • 7. SQL-based language specifications Sqlfunctions: Define XMLConstruct CUST (Custid: integer, CustName: varchar) AS { <Customer id=$Custid>$CustName </Customer>} Sqlaggregates: Select XMLAGG ( ITEM (item.id, item.desc) ) From Item item // returns an XML aggregation of items
  • 8. Customer Definition of XML Constructor Define XML Constructor CUST (custId: integer, custName: varchar(20), acctList: xml, porderList: xml) AS { < customer id=$custId> < name > $custName </ name > < accounts > $acctList </ accounts > < porders > $porderList </ porders > </ customer > } Input Output Output - A Customer XML Element Aggregate function XMLAGG – Concatenates XML Fragments produced by XML Constructor
  • 9. Sample SQL query constructs XML from relational tables Select cust.name, CUST(cust.id, cust.name, (Select XMLAGG(ACCT(acct.id, acct.acctnum)) From Account acct Where acct.custId=cust.id), (Select XMLAGG(PORDER(porder.id, porder.acct, porder.date, (Select XMLAGG(ITEM(item.id, item.desc)) From Item item Where item.poid=porder.id) (Select XMLAGG(PAYMENT(pay.id,pay.desc)) From Payment pay, Where pay.poid=porder.id))) From PurchOrder porder Where porder.custID=cust.id)) From Customer cust Correlated sub-query for customer’s Accounts Correlated sub-query For purchase orders Top Level query returns each customer from customer table Correlated sub-query returns XML fragment LINES 1-14 produces Scalar function returning Customer XML
  • 10. Implementation Alternatives Two main differences: Nesting (structuring) Tagging Space of alternatives: Late Tagging Early Tagging Late Structuring Early Structuring Inside Engine Inside Engine Inside Engine Outside Engine Outside Engine Outside Engine Stored Procedures CLOB
  • 11. Early tagging and structuring Stored Procedure - Outside the engine Approach Explicitly issue nested queries Algorithm:- First query & retrieve root elements (customers id, name) Using Customer id ,issue a query to retrieve account info. Next, for same customer id, issue a query to retrieve customers purchase order For each purchase order retrieved, query to get item and payment info. Once done Processing of one customer is over. Repeat same for next customer till entire XML Document is ready. Fixed order Nested Loop Join outside the ENGINE Tag/Structure as soon as structure is ready Many SQL queries issued/tuple for tables with nested structure.
  • 12. Early tagging and structuring Correlated CLOB - Inside the engine Approach Push queries into the engine Plug in XMLAGG, XMLCONSTRUCT support into engine Character Large Objects- CLOBS XML Fragments Performance Issues -handle huge CLOBS in engine Fixed join order – implies nested loop join strategy
  • 13. Efficiently Publishing Relational Data as XML Documents
  • 14. Early tagging and structuring De-Correlated CLOB - Inside the engine Approach\ Decorrelate and use Outer Joins – no longer fixed order Compute Account lists associated with all customers Compute Purchase order lists associated with all customers Join results above on customer id. Still carry around CLOBs (due to early tagging!)
  • 15. Efficiently Publishing Relational Data as XML Documents