I don't think you can compare structured types with tables. Unless you
mean typed tables vs. regular tables.
If anything I would compare structured types with XML.
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
>> I've been looking at the information on Structured Types in the
>> certifcation guide and have previously read it in the DB2 manuals. As
[quoted text clipped - 5 lines]
> Teh only common usage scenarios in DB2 for structured types are the
> spatial extenders.
>> I'm also curious to know if anyone is finding them dramatically better
>> than regular tables? If so, WHY are they finding the structured types so
>> good?
> I don't think you can compare structured types with tables. Unless you
> mean typed tables vs. regular tables.
> If anything I would compare structured types with XML.
Sorry, as I reread this note I realize that the first paragraph should have
said "Structured Types AND TYPED TABLES" where I said "Structured Types". I
was really thinking of those two together, not just the structured types by
themselves. They seemed so closely related that I applied the same term to
both when I should have made the distinction.
Having clarified that, am I correct in suspecting that neither structured
types nor typed tables get much use in the real world and that they are
really just there for the bragging rights - "we have this too, just like
Competitors X and Y" - as opposed to some huge demand for these facilities?
I'm a little surprised to hear you say that structured types are used mainly
for spatial extenders and get little use anywhere else. I rather expected
that the ability to have, in effect, "custom datatypes", like phone numbers,
might actually be quite useful and prevent errors like arithmetic
comparisons between phone numbers and employee numbers. Then again, maybe
most users were already smart enough to avoid comparisons between apples and
oranges and didn't need DB2 to enforce that for them.
And yes, I did mean to compare typed tables with regular tables. When would
people use a typed table in preference to a regular table? I can see the
advantages for representing data in a more OO-manner but aren't there some
major performance penalties in having all of the data in the same physical
table? I'm curious to know when the advantages of typed tables outweigh the
disadvantages for most users.
--
Rhino
Serge Rielau - 10 Dec 2007 17:00 GMT
>> Having clarified that, am I correct in suspecting that neither structured
> types nor typed tables get much use in the real world and that they are
> really just there for the bragging rights - "we have this too, just like
> Competitors X and Y" - as opposed to some huge demand for these facilities?
I think it was more than that. At the time it was believed that it was
truly needed.. just like XML.
> I'm a little surprised to hear you say that structured types are used mainly
> for spatial extenders and get little use anywhere else. I rather expected
[quoted text clipped - 3 lines]
> most users were already smart enough to avoid comparisons between apples and
> oranges and didn't need DB2 to enforce that for them.
What you are discussing here are not structured types, but what teh
standard knows as DISTINCT TYPES. DB2 has had distinct types since DB2
V2. Unfortunately it is one of few products with that support in SQL.
Distinct tupes are indeed used by those who care for such things.
Ironically distinct types go counter to the other direction in the
industry of weak typing. "If it walks like a duck and it quacks like a
duck.. it must be a duck" (see Ruby, PHP, ...). DB2 has become the last
hold-out of strong typing.
> And yes, I did mean to compare typed tables with regular tables. When would
> people use a typed table in preference to a regular table? I can see the
> advantages for representing data in a more OO-manner but aren't there some
> major performance penalties in having all of the data in the same physical
> table? I'm curious to know when the advantages of typed tables outweigh the
> disadvantages for most users.
I was the developer of typed views. It was my first shipped feature :-)
The advantage of typed tables, at least in DB2, is not in increased
performance. Matter of fact the whole hierarchy is stored within one
regular table (aka "hierarchy" table).
It is very hard to track usage of features in the field with any other
metric than PMRs. There are few on typed table and views. Must be teh
bullet proof code ;-)
Some features customers use.. others... no
Cheers
Serge

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab