P. 1


|Views: 18|Likes:
Published by mmmaheshwari

More info:

Published by: mmmaheshwari on Mar 02, 2013
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Many advantages are provided by pureXML technology.

1. You can seamlessly leverage your relational investment, given that XML
documents are stored in columns of tables using the new XML data type.

2. You can reduce code complexity. For example, Figure 15.5 illustrates a PHP script
written with and without using pureXML. Using pureXML (the smaller box on the
left side) the lines of code are reduced. This not only means that the code is less
complex, but the overall performance is improved as there are fewer lines to parse
and maintain in the code.

Figure 15.5 – Code complexity with and without pureXML

3. Changes to your schema are easier using XML and pureXML

technology. Figure
15.6 illustrates an example of this increased flexibility. In the figure, assume that

266 Getting Started with DB2 Express-C

you had a database consisting of the tables Employee and Department. Typically
with a non-XML database, if your manager asked you to store not only one phone
number per employee (the home phone number), but also a second phone number
(a cell phone number), then you could add an extra column to the Employee table
and store the cell phone number in that new column. However, this method would
be against the normalization rules of relational databases. If you want to preserve
these rules, you should instead create a new Phone side table, and move all phone
information to this table. You could then also add the cell phone numbers as well.
Creating a new Phone table is costly, not only because large amounts of pre-
existing data needs to be moved, but also because all the SQL in your applications
would have to change to point to the new table.

Instead, on the left side of the figure, we show how this could be done using XML.
If employee Christine also has a cell phone number, a new tag can be added to
put this information. If employee Michael does not have a cell phone number, we
just leave it as is.

Figure 15.6 – Increased data flexibility using XML

4. You can improve your XML application performance. Tests performed using
pureXML technology showed huge improvements in performance for XML
applications. Table 15.1 shows the test results for a company that switched to
pureXML from older technologies. The second column shows the results using the
old method of working with XML using another relational database, and the third
column shows the results using DB2 with pureXML.


Other relational DB

DB2 with pureXML

Development of search and CLOB: 8 hrs

30 min.

Chapter 15 - DB2 pureXML 267

retrieval business processes

Shred: 2 hrs

Relative lines of I/O code


35 (65% reduction)

Add field to schema

1 week

5 min.


24 - 36 hrs

20 sec - 10 min

Table 15.1 – Increased performance using pureXML


You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->