Product Documentation

Knowledgebase

Previous Topic

Next Topic

Huge Files

A FairCom DB data or index file that is created with 8-byte offset support is known as a HUGE file. A non-HUGE file is limited to 2 or 4 GB in size, depending on system file limits. An 8-byte file offset provides a maximum file size of more than 1.844 x 1019 bytes per file, so a HUGE file effectively eliminates practical constraints on the file size.

In This Section

When to Use Huge Files

Creating Huge Files

Previous Topic

Next Topic

When to Use Huge Files

Use HUGE files when the maximum size of a file is expected to exceed 2 GB. The consequence of using a non-HUGE file is that the system-imposed 4-byte offset file limit places a hard limit on the supported file size. When a non-huge file reaches the system file size limit, operations that require the file size to increase (such as adding records or updating variable-length records) will fail. Only deleting records or creating a new file will allow additional records to be added to a non-huge file when it reaches this state. Using huge files avoids this limitation.

Note that even when using huge files, the maximum size of a file FairCom DB can create is limited by operating system and file system limits on file sizes. For example, on many Unix systems, the ulimit or limit command can set arbitrary limits on the size of a physical file. When developing a system, review operating system and file system file size limits to ensure they support the system’s physical file size requirements. If the system’s file size limits are too restrictive, consider using the c tree Server’s segmented file support (described later) to overcome the file size limitations.

Previous Topic

Next Topic

Creating Huge Files

To create HUGE data and index files, create an array of XCREblk (extended create block) structures, one for each physical data and index file to be created. Include the ctFILEPOS8 attribute in the x8mode field of each extended create block structure. Call an Xtd8 create function such as CreateIFileXtd8(), passing the extended create block array to the function.

Note: Any index referencing a data file created using 8-byte file addresses must also use 8-byte file addresses. A ctFILEPOS8 data file requires a ctFILEPOS8 index. A ctFILEPOS8 index supporting duplicate keys must allow for 8 bytes in its key length for the automatic tie-breaker that FairCom DB automatically appends to the key value.

TOCIndex