12.7 Specifying the FIX attribute
(1) Effects of specifying the FIX attribute
The effects of specifying the FIX attribute for a table are discussed as follows.
- Improved performance
- The performance of retrieving a specific column becomes constant regardless of the order of the column definitions. Additionally, the column retrieval time is reduced, compared to when the FIX attribute is not specified.
- Access performance is improved even when there are many columns because a UAP can use an interface for each row.
- Improved operability
- If the null value is found in the input data when a column of a table with the FIX attribute is being updated, it can be excluded as an error.
- Reduction of required disk space
- The physical row length is 2 bytes shorter per column than when the FIX attribute is not specified. If a table contains many columns, disk space is saved.
(2) Criteria
If the null value will not be used in any column and no column is of variable length, the FIX attribute should be specified during table definition.
When these conditions are not satisfied, the following should be evaluated:
- If columns will be added to a table in the future, define a reserved column during table definition. Once you have defined a reserved column, you can add columns to the table even after data has been stored.
- Use the 0 (numeric data) or the space (character data) instead of the null value. Note that the null value is treated differently in search conditions and set functions than other values.
- Change variable-length data with a small maximum value or small range of actual lengths to fixed-length data. Note that variable-length data is handled differently in search conditions.
(3) Specification
To assign the FIX attribute to a table, FIX is specified in the CREATE TABLE definition SQL (that is, CREATE FIX TABLE is specified).
(4) Notes
A reserved column is an area reserved for future use (for adding columns). You cannot perform insert or update processing using desired values on a reserved column. HiRDB stores in the reserved column as many null characters (0x00) as the defined length of the reserved column. Therefore, when you estimate the size of an RDAREA for storing tables, you must include the reserved column in determining the number of table storage pages. The following figure shows how to use a reserved column.
Figure 12-19 How to use a reserved column
![[Figure]](figure/zu120701.gif)