Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2007

Tip: Looking for answers? Try searching our database.

Structured Types

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rhino - 10 Dec 2007 07:24 GMT
I've been looking at the information on Structured Types in the certifcation
guide and have previously read it in the DB2 manuals. As neat as Structured
Types are, I'm very curious to know if they are being heavily used in the
real world? Or are they just a "nice to have" feature that no one actually
uses?

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?

--

Rhino
Serge Rielau - 10 Dec 2007 11:56 GMT
> I've been looking at the information on Structured Types in the certifcation
> guide and have previously read it in the DB2 manuals. As neat as Structured
> Types are, I'm very curious to know if they are being heavily used in the
> real world? Or are they just a "nice to have" feature that no one actually
> uses?
If you ask me OO in RDBMS was a knew-jerk reaction to fend of OODBMS
(which, as well all know now remained niche products).
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.

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

rhino - 10 Dec 2007 16:45 GMT
>> 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

Knut Stolze - 10 Dec 2007 17:36 GMT
> I've been looking at the information on Structured Types in the
> certifcation guide and have previously read it in the DB2 manuals. As neat
[quoted text clipped - 5 lines]
> than regular tables? If so, WHY are they finding the structured types so
> good?

I think Serge already summed it up quite nicely.  As a bit of background
information on the DB2 Spatial Extender: structured types were used in this
product to provide encapsulation for different pieces of geometries and
also to tie special spatial indexing mechanisms.  (The indexing questions
could be solved in different ways, too.)  Internally, the spatial data
types contain a BLOB in which all the geometry data is encoded.

I consider one thing as a really nice feature for structured types: if you
wrap a BLOB/CLOB into such a type, you can exploit the buffer pools for
small LOBs while really large objects are treated as always.

Signature

Knut Stolze
DB2 z/OS Utilities Development
IBM Germany

Serge Rielau - 10 Dec 2007 18:25 GMT
> I consider one thing as a really nice feature for structured types: if you
> wrap a BLOB/CLOB into such a type, you can exploit the buffer pools for
> small LOBs while really large objects are treated as always.
True... but that's hardly an OO feature. After fixing blocking and DRDA
inlining for LOBs in DB2 9.5 there's hope this OO advantage's days are
numbered.

Cheers
Serge
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Knut Stolze - 11 Dec 2007 09:32 GMT
>> I consider one thing as a really nice feature for structured types: if
>> you wrap a BLOB/CLOB into such a type, you can exploit the buffer pools
>> for small LOBs while really large objects are treated as always.
>
> True... but that's hardly an OO feature.

Naturally...

> After fixing blocking and DRDA
> inlining for LOBs in DB2 9.5 there's hope this OO advantage's days are
> numbered.

In case I can vote here: I'm all for it. ;-)

Signature

Knut Stolze
DB2 z/OS Utilities Development
IBM Germany

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.