ITEM: CB4034L
How is space alloacted for a VARCHAR field?
ENV:
DB2 v2.1+
Any OS
Any Hardware
DESC:
Please answer the following questions on how space is alloacted
within a table for a VARCHAR field.
1. I need to understand how space is allocated for a nullable
varchar field when going from a null value to some none null
value?
FOR EXAMPLE
============
Is space realloacted all the time or does is reuse the so that
if the field where padded blank I would see better performance?
2. Is there some sort of space preallocation tool available as in
the DB2 MVS world to hanlde the issues in question 1?
ACTION:
Rows are updated in place. If the after image of the row is larger
and there is no room left in the 4KB page a tombstone record is
created in the original row pointing to a new location in the
table. The new location is found on a first-fit order using the
free space map of the table.
For performance purposes VARCHAR are the best datatype. If you know
aproximate size of waht the VARCHAR will grow to then they may want
to pad the column accordingling (dummy data), to prevent tombstone
records.
There is no tool at present as found in the MVS world for this padding
funcrtion.
Support Line: How is space alloacted for a VARCHAR field? ITEM: CB4034L
Dated: December 1996 Category: N/A
This HTML file was generated 99/06/24~13:30:18
Comments or suggestions?
Contact us