Table fields

Before defining a table, you should have already used the Field Definition window to create the global fields that will be used for the table. To add global fields to the table, simply select the global field in the Global Fields list and click Insert; the field will be added to the table definition after the item currently selected in the Table Fields list. If no field is selected in the Table Fields list, the global field will be inserted at the top of the list.

The order in which you insert fields into the Table Fields list is not critical. There is only one significant consideration when inserting fields into a table definition. For optimal performance, it is desirable to group string fields next to each other in the table definition. This is particularly true for string fields that will be used in keys for the table. Through a process called segment combining, Dexterity treats adjacent string fields as a single item, allowing it to perform some table operations more efficiently.

The position of the fields in the Table Fields list is significant. Data in the table is stored according to the position of the fields in the Table Fields list. If you insert additional table fields or change the position of the fields, any existing data will need to be converted in order to be accessed properly. Data conversion is described in Updating an Application.

Record size

A record is made up of two parts: a fixed-length part and a variable-length part.

[spacer]

The fixed-length portion of the record stores all fields with fixed lengths. For Pervasive.SQL tables, the fixed-length portion can be up to 4,088 bytes (approximately 4K). For c-tree tables, it can be up to 32,767 bytes (32K). For SQL tables, the fixed-length portion can be up to 8,060 bytes. In all cases you should try to keep the fixed-length portion as small as possible for maximum performance.

The variable-length portion of the record stores all variable-length fields such as pictures and big text fields. These fields share 32K of variable space. For example, if a table stored a 10K picture and a big text field, the text field could store up to 22K of text for a total of 32K.

The record size of the fixed-length portion of the record is calculated automatically as fields are added or removed; the total record size equals the combined storage size of all the fixed-length fields that have been inserted into the table.

Encryption

You can encrypt fields by selecting them in the Table Fields list and marking the Encrypt option. An asterisk will appear next to each encrypted field. Encryption is used for fields such as password fields to prevent users from reading the passwords by viewing the table data with a file viewing utility.


Documentation Feedback