4D v12.4

Compact page

Home

 
4D v12.4
Compact page

 

Compact page  


 

 

You use this page to access the data and structure file compacting functions.

Compacting files meets two types of needs:

  • Reducing size and optimization of files: Files may contain unused spaces (“holes”). In fact, when you delete records, forms, and so on, the space that they occupied previously in the file becomes empty. 4D reuses these empty spaces whenever possible, but since data size is variable, successive deletions or modifications will inevitably generate unusable space for the program. The same goes when a large quantity of data has just been deleted: the empty spaces remain unassigned in the file.
    The ratio between the size of the data file and the space actually used for the data is the occupation rate of the data. A rate that is too low can lead, in addition to a waste of space, to the deterioration of database performance. Compacting can be used to reorganize and optimize storage of the data in order to remove the “holes”.
    The “Information” areas summarize the data concerning the fragmentation of the files and suggests operations to be carried out. The tabs on the “Information” page of the MSC indicate the current fragmentation of the database files.
  • Complete updating of data by applying the current formatting set in the structure file. This is useful when data from the same table were stored in different formats, for example after a change in the database structure.

Note: Compacting is only available in maintenance mode. If you attempt to carry out this operation in standard mode, a warning dialog box will tell you that the database will be closed and restarted in maintenance mode. You can compact a data file that is not opened by the database (see below).

The standard compacting procedure for the data and structure file are identical. 

To directly begin the compacting of the data or structure file, click on the corresponding button in the MSC window:

Data:       

Structure:

Note: Since compacting involves the duplication of the original file, the button is disabled when there is not adequate space available on the disk containing the file. 

This operation compacts the main file as well as any index files. 4D copies the original files and puts them in a folder named Replaced Files (Compacting), which is created next to the original file. When the operation is completed, the compacted files automatically replace the original files. The database is immediately operational without any further manipulation.

Notes:

  • You can modify the folder where the original files are saved using the advanced mode.
  • If you have carried out several compacting operations, a new folder is created each time. It will be named “Replaced Files (Compacting)_1”, “Replaced Files (Compacting)_2”, and so on.

Warning: Each compacting operation involves the duplication of the original file which increases the size of the application folder. It is important to take this into account (especially under Mac OS where 4D applications appear as packages) so that the size of the application does not increase excessively. Manually removing the copies of the original file inside the package can be useful in order to keep the package size down.

After compacting is completed, 4D generates a log file in the database folder. This file, named databasename_compact_log, is created in XML and HTML format. It can be used to view all of the operations carried out.
When you click on the Open log file button, 4D displays the log file in HTML format in the default browser of the machine (see Open log file).

The Compact page contains an Advanced> button, which can be used to access an options page for compacting data and structure files:

The “Compact records and indexes” displays the pathname of the current data file as well as a [...] button that can be used to specify another data file. When you click on this button, a standard Open document dialog box is displayed so that you can designate the data file to be compacted. You must select a data file that is compatible with the open structure file.
Once this dialog box has been validated, the pathname of the file to be compacted is indicated in the window. 

The second [...] button can be used to specify another location for the original files to be saved before the compacting operation. This option can be used more particularly when compacting voluminous files while using different disks.

The “Compact structure file” area displays the pathname of the database structure file as well as a [...] button that can be used to specify another location for the original files to be saved before compacting begins.

When you click on one of the Compact buttons, the operation begins immediately. When compacting is complete, 4D generates a report in the database folder. When you click on the Open log file button, 4D displays the log file in HTML format in the default browser of the machine (see Open log file).

 
PROPERTIES 

Product: 4D
Theme: Maintenance and security center