Max Row Lenghth

Database
Enthusiast

Max Row Lenghth


Hi,

As per the Teradata, we know that max row length is 64KB.

But how come we have datatypes ( CLOB and BLOB ) which support GBs of data.

Thanks,
Syed
4 REPLIES
Enthusiast

Re: Max Row Lenghth

LOBs are never stored as part of the physical row of the data subtable, but are implemented as LOB subtables. So there will be a LOB subtable for each LOB column in the table.

The primary data row is linked to the subtable record by means of an Object identifier (which is stored in the actual primary data row).

Within the LOB subtable, if we take a single LOB value into consideration, it's contents would be broken into multiple rows internally and given a sequence number to each row (this structure is transparent to user for all practical purposes).

The subtable row structure will have a rowhash (same as primary data row rowhash), uniqueness value,sequence fields in it's row header. The rowhash + uniqueness value will be the same for all the rows belonging to the "Same" LOB value's contents. The sequence is used to identify the order of records for the given LOB value.

The sequence field is 15 bits, so you can have 32K recs for a single LOB value. So if we take max row size (64k) into account, then we have the largest possible LOB to be 32k*64K = 2GB.

Enthusiast

Re: Max Row Lenghth



Hi,

Thanks for the reply, it really helped me.

Regards,
Syed
Enthusiast

Re: Max Row Lenghth

Just one small correction to joedsilva's excellent explanation: The maximum LOB size is actually 32767*64000 = 2,097,088,000 bytes.
Enthusiast

Re: Max Row Lenghth

it's sort of like how our 80GB laptop hard drive in fact is 74.5 GB