Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Development Trends in Web and Oracle

Re: Development Trends in Web and Oracle

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Sat, 12 Mar 2005 22:44:09 +0000
Message-ID: <u0q631p9v0gn6llub5oak0nimkpdu4hcji@4ax.com>


On Sat, 12 Mar 2005 21:21:03 -0000, "Hexathioorthooxalate" <ruler_at_removemetoemail.clara.co.uk> wrote:

>> Nothing moves anywhere without running through the CPU. Given disk is
>> cheap one could potentially overlook all of this but what can not
>
>Daniel, the XML isn't stored as a CLOB, it is shredded & recomposed! The
>argument is valid if were storing XML as a LOB.

 Is this referring to storage in an XMLType column? I've only had a passing glance at XMLType so far, so was curious as to the storage requirements. So I've created a table and a row as follows:

SQL> create table t (x xmltype);

Table created.

SQL> insert into t values ('<a>b<c>d</c><e>f<g>h</g></e></a>');

1 row created.

SQL> commit;

Commit complete.

 Then done a block dump to have a look at how it's stored. The row comes out as:

block_row_dump:
tab 0, row 0, @0x1f58
tl: 72 fb: --H-FL-- lb: 0x1 cc: 1
col 0: [68]
 00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 06 4d 49 00 30 09 00 00  00 00 00 00 20 00 00 00 00 00 01 3c 61 3e 62 3c 63 3e 64 3c 2f 63 3e 3c 65  3e 66 3c 67 3e 68 3c 2f 67 3e 3c 2f 65 3e 3c 2f 61 3e end_of_block_dump

 ... which appears to be rather a lot of extra padding around the XML itself. CLOB storage might even be more space-efficient!

 Daniel's sarcastic XML comes out as:

col 0: [114]
 00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 06 4d 4a 00 5e 09 00 00  00 00 00 00 4e 00 00 00 00 00 01 3c 52 49 44 49 43 55 4c 4f 55 53 4c 59 4c  4f 4e 47 54 41 42 53 49 47 4e 49 46 59 49 4e 47 4e 4f 54 48 49 4e 47 3e 58  3c 2f 52 49 44 49 43 55 4c 4f 55 53 4c 59 4c 4f 4e 47 54 41 42 53 49 47 4e  49 46 59 49 4e 47 4e 4f 54 48 49 4e 47 3e

 In another reply you said:

>b) Mixing XML in existing relational databases in legacy systems is a bit
>hodge-podge. Maybe the safe bet for existing systems is to stay totally
>relational, I don't know. Perhaps new implementations might are up for
>debate with less resistance?

 I think I have to agree here; Oracle's got decent XML support, but I'm not sure it ties together at all well having a mix of relational data and XML data.

 I can certainly see ways that a pure XML-based database could work well, converting the raw XML into a more efficient and searchable form to make XPath or XQuery queries efficient - XML's ripe for compression techniques, and if you have an XML Schema then it could derive even more specific data structures to store, index and query the XML. I think XML Schemas or at least DTDs are a must, else you descend quickly into data anarchy.

 If you've got an XML Schema isn't it possible to automatically derive a relational schema that can store the XML? (Or at least, one possible relational schema - there are likely various ways to represent an XML Schema in relational form, but given consistent rules it should be possible to deterministically come up with the same relational schema for a given XML Schema?). If you're already inside a relational database, and it's mapping XML into a relational schema, then you could have the option of issuing an XPath query which the server translates internally to SQL against the data; or you could just use SQL against the relational schema itself.

 This might be where Oracle was trying to go with indexes on XML, but it strikes me as still being a bit too opaque; you can't issue SQL against the data represented by the XML.

 Anyway, enough rambling :-)

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Received on Sat Mar 12 2005 - 16:44:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US