Friday, January 28, 2011

World Economic Forum, Parking Problems, and DB2 pureXML

Official logo of the World Economic Forum.Image via Wikipedia
The World Economic Forum in Davos certainly is interesting, at least from a perspective of logistics and data. A lot of the big and famous try to be there. And who has thought that parking is a problem?

When you want to fly into Davos, you usually fly into Zurich airport (ZRH) or the airport in Friedrichshafen (FDH). The latter is close to where I live and this morning it was still serving as a parking lot for small and big private jets from around the world. Some of the VIPs have been flying directly into FDH and changed into helicopters or cars, but a good chunk opted for the "fly to Zurich, park your jet in Friedrichshafen" option. For the average guy it seem funny that even with some money behind you get into parking problems. Well, not the regular ones...

How do I get the drift to database systems? You cannot just fly to an airport and hope for the best. There is some trip planning and logistics involved, and a lot of communication. These days, parking your vehicle needs some extra communication. The more efficient the better.

Now to DB2 and pureXML: A lot of applications send XML to the database or retrieve it from the database. So far it meant that the sender had to produce text-based XML data from its internal structures, the receiver had to parse it and produce its internal structures. Both takes time and costs money (we are living in a fast world). Starting with DB2 10 for z/OS, both the DB2 client and server use binary XML, a special optimized format for encoding XML documents. This allows to produce the "on the wire" representation faster and is also simpler to process on the receiving side. Communication made faster and more efficient, a better chance to find a parking space for your vehicle of choice...?

Monday, January 24, 2011

Why XML columns have a length of zero

One interesting question when looking at the meta data of tables is why XML columns don't have a length.

db2 "create table thebigq(id int, name varchar(40), doc xml inline length 1000)"
DB20000I  The SQL command completed successfully.

hloeser@BR857D67:~/1Q11$ db2 describe table thebigq

                                Data type                     Column
Column name   schema    Data type name Length     Scale Nulls
------------- --------- -------------- ---------- ----- ------
ID            SYSIBM    INTEGER                 4     0 Yes  
NAME          SYSIBM    VARCHAR                40     0 Yes  
DOC           SYSIBM    XML                     0     0 Yes  

  3 record(s) selected.

Well, for an INTEGER type the size is well-known because of the bits allocated to store the value. For VARCHAR strings the specified length (in bytes) is what is shown. For XML columns, however, there is no maximum size that you can specify. This is in contrast to LOBs (BLOBs, CLOBs). There is also no maximum size of an XML document on disk, it is only determined by storage and possibly the document structure.

When pureXML was designed, there was a long discussion on what the length as shown above should be. Should we just show a really big number, like 2GB, or decide that it is -1 or -2?

Inserting a 2GB big XML document - this is the maximum that can be transferred into DB2 - can take up more storage space than 2 GB or less. Hence, it is not a good value. The options "-1" or other negative numbers usually have a special meaning and therefore were also not chosen. So it became zero (0) - XML values have the size they have. Something mystic...!?!

Monday, January 17, 2011

Current DB2 Fixpacks

The year is still young, but I already had a business trip last week. When looking at/after your systems, planning new ones, or just teaching or discussing DB2, it is good to know where we are in current fixpack levels.

The page "DB2 Fix Packs by version for DB2 for Linux, UNIX, and Windows" lists all of them from version 8.2 to 9.8. As today, DB2 9.5 is at FP7 (released December 13th, 2010), DB2 9.7 at FP3a (released October 20th, 2010), and DB2 9.8 (this is the pureScale feature) is at FP3 (released December 17th, 2010). As you can see, two fixpacks for the recent DB2 versions came out just before the holidays.

Hello and some lessons from the holidays

I just wanted to say "Hello" and wish you the best for 2011. I am already deep into work and haven't had time (or the energy?) to post. However, I wanted to share some lessons from the holidays with you:

  • Think about the impact of your actions.
  • Time is valuable, don't waste it.
How come? I am owner of a discount card for the German Railway for my business travel. And railway company sent me an email wishing me happy holidays and in the subject even mentioning a gift for me. After opening the email (I love real gifts and I am curious), I read it and saw that the gift was a "some Euros off" coupon for my next travel. Then I read saw that - as usual - some footnotes were attached.

  • The coupon was only valid for December 24th to 31st. This was the first bummer.
  • It was only valid on certain trains. 2nd bummer.
  • It was only valid with a certain minimum travel value. 3rd bummer.
In other words: The "gift" was worthless to 99.5% of the recipients. Probably some marketing guy had an idea for a campaign to hand out gifts to our most valued customers and got it approved because it doesn't cost anything. Well, it cost something because if the railway company would just have wished a happy holiday, everything would have been fine. But by wasting their customers time and sending something worthless and overpromising, it left  disappointed recipients behind.