On Fri, 29 Mar 2013 03:48:35 -0400, Helmut Tessarek wrote:
> There are 2 things I do not touch: XML and Java. That's why I asked
> Matthias to answer your questions. Matthias is one of the architects
> (next to Don) for the XML engine, so you won't find anybody else who'd
> be more qualified to answer any questions wrt XML.
>
> There is a big difference in XML documents defined as a LOB field and
> XML as an XML column. We are using a relational engine and an XML engine
> in DB2 and depending how it is defined, the type has either more or less
> similarities with a LOB type. (Even when a document was defined as a
> LOB, it was still not 100% the same as a LOB.) Don't forget that a lot
> of people do not use exclusively XQuery to access XML data, but use a
> mix of SQL and XQuery. There are situations where the optimizers (SQL
> and XML engine) might not be able to access the data as it was supposed
> to be. Please elaborate what this person told you about how XML and LOB
> have more in common than IBM wants you to believe. I'm sure there are
> situations where this is the case, but they should be rather the
> exception.
>
> But I am definitely not the person to talk about XML, since the only
> thing I know about XML is how you spell it. :-)
I think there is apparently confusion here. I know the feature/functional differences of storing XML in
CLOB vs pureXML. I don't care about that. I don't care about whether one can use XQuery with
pureXML and cannot with CLOB/Varchar. My only concern is performance and how data in pureXML is
cached. The comparison between CLOB and pureXML is not being made because I am thinking about
storing XML in a CLOB, it is because they appear to have a lot of things in common in terms of the way
they are handled in DB2. Here are few examples:
1. Both LOB and pureXML can be INLINE'd. We certainly know why that is the case for LOB columns,
because LOB’s don't use bufferpools, and INLINE improves performance dramatically. But we are being
told that pureXML is stored in bufferpools, but at the same time we are being told that one should
INLINE pureXML whenever possible to improve performance. This makes no sense unless there is
something fundamentally and materially different about pureXML caching in bufferpools as compared
to data/index caching in bufferpools.
2. Both LOB and pureXML columns cannot be accessed in a HADR Standby database enabled for read-
only access (RoS). There must be some architectural reason (or limitation) why that is the case, and it
is reasonable to assume (although I don't have proof) that LOB and pureXML columns have something
in common in the way they are processed internally within DB2 that has so far prevented IBM from
making them available for RoS.
As to what the IBM employee (who is a DB2 LUW instructor, or at least was when I talked to him) said
about the similarities of LOB columns and pureXML, I don't have anything other to add besides what he
said (that LOB and pureXML columns have more in common than IBM wants you to believe). It was
only a 30 minute job interview, and I didn’t have time to go into more detail on this with him.
Please, please, stop talking about the advantages of pureXML over storing XML in VARCHAR or CLOB
columns. That has nothing to do with what I am asking about, and I fully understand the advantage of
pureXML (and also INLINE).