Tech Note: Compacting Address Tables
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: October 5, 2010
In 4D v11 SQL, address tables are no longer compacted as part of a database Compact operation, using the Maintenance and Security Center. This change was made in order to preserve record numbers after a compact. However large, empty address tables can have an effect on memory and performance, thus it can still be useful to compact them.
This Technical Note explores this issue and includes a component that can be used to compact address tables.
Download Complete Tech Note and Example: Windows | Mac
However the DATA_LENGTH calculation for Alpha fields changed in v12.5+ and v13.1HF1+; in those versions the calculation appears to be alpha_field_length*2 so the following code:
$length_l:=($length_l-4)/2
should be changed to:
$length_l:=($length_l)/2
This is lines 46 and 47 of UTIL_SQL_TypeIdToName