Subject Large database file support
Author Leyne, Sean
All,

Since there is an ongoing thread about large file support issues and
since I'm responsible for doing the research for the large file changes
to the Firebird engine, I thought I would publish this definitive
response (I hope I get the *nix stuff right).

First, the issue relates to the size of a single database file, not the
the size of a logical database can be made up of a primary file and
numerous secondary files (the standing record for a single FB/IB
database is 980GB!)

Second, the size issue is really the result of 3 separate factors -- the
implementation (coding) of the FB/IB engine I/O functions, the support
for 64bit file operations and support for large files by the filing
systems.

In the case of the engine implementation, all FB/IB versions prior to FB
v1.0 (including IB v6.0) used both 32 bit API/OS calls and 32 bit
(integer) file pointer structures. Thus, the engine was capable
designed to handle a maximum file size of 4GB. Unfortunately, in the
*nix code the file pointer structures where also defined as signed
integers, which resulted in a maximum size of 2GB.

In the case of the OS issues, I'll discuss MS Windows first.

By design, all versions of Win32 (Win9x/ME/NT/2000) provide full support
for 64bit pointer file operations -- you just have to pass the right
file pointer structure. So all that was necessary to add large file
support for Firebird was to change the file pointer structure to
LARGE_INTEGER and slightly modify the I/O calls themselves.

In the case of *nix, 64bit file operations are only supported with the
latest (v2.4) glibc. This support only ships with the latest
distributions (Red Hat 7.x and Mandrake 8.x), although I understand that
existing installs can be updated. Since support is not guaranteed for
all platforms, there will be 2 versions of the Firebird *nix ports
(32bit and 64bit I/O).

Finally, now that the engine can supports 64bit operations, it is
important to remember that not all filing systems support large files.

In the case of Win32, the following *file* size (not to be confused with
partition/volume) limits apply:

FAT16 for Win9x/ME, max file size = 2GB - 1byte
FAT16 for WinNT/2000, max file size = 4GB - 1byte
FAT32 for Win9x/ME/2000, max file size = 4GB - 1byte
NTFS for WinNT/2000, max file size = 16,384GB - 1byte

In the case of *nix, because there are so many different filing systems
you should consult the following URL for the exact details --
http://www.suse.de/~aj/linux_lfs.html


Sean