dimitr 8512328216 Updated docs & version info. hace 11 años
..
license 45fff85df5 Corrected the license URLs. hace 15 años
sql.extensions 7ca129fd6e Fixed doc. mismatch reported by Paul Vinkenoog hace 15 años
Firebird_conf.txt 4e040037e7 Fixed the docs. hace 19 años
README.DiskSpaceAllocation 1b83fbc2c8 A bit better wording. hace 18 años
README.NTSecurity df59a7a41a misc hace 18 años
README.Optimizer.txt 854da4e241 Misc. hace 21 años
README.Win32LibraryInstallation.txt 6a47a28ba0 More Win32 1.5 -> HEAD synchronisation. Updated documentation regarding gds32.dll and instclient.exe hace 22 años
README.build.mingw.html c9ba5d9fb3 Misc hace 19 años
README.build.msvc.html 9a3a71029d Misc hace 19 años
README.coding.style 4ca32b84ec An additional related to previous commit hace 22 años
README.fbsvcmgr d73fd1edc7 Added missing SPB parameter hace 18 años
README.garbage_collector 902671a044 Misc. hace 20 años
README.incompatibilities.txt 1c3957d16c Corrections. hace 18 años
README.instsvc df59a7a41a misc hace 18 años
README.intl 57bc673712 Added comment describing codepage as suggested by Philippe Makowski hace 17 años
README.isql_enhancements.txt e857b19539 Explain other isql options. hace 20 años
README.makefiles 4a80dfe3a8 Note for POSIX builders hace 19 años
README.monitoring_tables 1136624b7f Update. hace 18 años
README.performance_monitoring 59b235cea3 Small corrections hace 22 años
README.raw_devices b387c0dd80 misc hace 18 años
README.sha1 a749151080 Correct some files to refer to FB2 and security2.fdb hace 21 años
README.trusted_authentication 422d659fcb Misc. hace 19 años
README.user f676883248 Misc hace 19 años
README.user.embedded 3b2663b68c Correction. hace 15 años
README.user.troubleshooting 7abd992530 Added troubleshooting guide and simple user intro hace 23 años
README.xnet c5c49d5e5e Added description of XNET. hace 20 años
WhatsNew 8512328216 Updated docs & version info. hace 11 años
ambiguity.txt 89af0c2a66 Little corrections. hace 21 años
cleaning-todo.txt 055d3a4099 Update some docos. hace 21 años
emacros-cross_ref.html 503cd1e4ae Change document name hace 22 años
fb2-todo.txt 0f7cd8ec8b A couple TODO items I forgot hace 22 años
install_win32.txt 6a47a28ba0 More Win32 1.5 -> HEAD synchronisation. Updated documentation regarding gds32.dll and instclient.exe hace 22 años
install_windows_manually.txt 351b41fba6 Clarify a point hace 18 años
ods11-index-structure.html 4569af61eb ODS11 index structure description hace 21 años

README.DiskSpaceAllocation


Since the beginning, Firebird had no rules of how to allocate disk space
for database file(s). It just writes new allocated pages in not determined
order (because of dependencies between pages to serve "careful write" strategy).

This approach is very simple but has some drawbacks :

- because of not determined order of writes, there may be such situation when
page cache contains many dirty pages at time when new allocated page must be
written but can't because out of disk space. In such cases often all other
dirty pages are lost because administrators prefer to shutdown database
before making some space on disk available. This leads to serious corruptions.

- allocating disk space by relatively small chunks may lead to significant file
fragmentation at file system level and reduce performance of large scans (for
example during backup).


Using new ODS 11.1, Firebird changes its disk space allocation algorithm to
avoid corruptions in out of disk space conditions and to give the file system a
chance to avoid fragmentation. These changes are described below.

a) Every newly allocated page is written on disk immediately before returning to
the engine. If page can't be written then allocation doesn't happen, PIP bit
is not cleared and appropriate IO error is raised. This error can't lead to
corruptions as we have a guarantee that all dirty pages in cache have disk
space allocated and can be written safely.

This change makes one additional write of every newly allocated page compared
with old behavior. So performance penalty is expected during the database file
growth. To reduce this penalty Firebird groups writes of newly allocated pages
up to 128KB at a time and tracks number of "initialized" pages at PIP header.

Note : newly allocated page will be written to disk twice only if this page
is allocated first time. I.e. if page was allocated, freed and allocated again
it will not be written twice on second allocation.

b) To avoid file fragmentation, Firebird used appropriate file system's API to
preallocate disk space by relatively large chunks. Currently such API exists
only in Windows but it was recently added into Linux API and may be implemented
in such popular file system's as ext2, etc in the future. So this feature is
currently implemented only in Windows builds of Firebird and may be implemented
in Linux builds in the future.

For better control of disk space preallocation, new setting in Firebird.conf
was introduced : DatabaseGrowthIncrement. This is upper bound of preallocation
chunk size in bytes. Default value is 128MB. When engine needs more disk space
it allocates 1/16th of already allocated space but no less than 128KB and no more
than DatabaseGrowthIncrement value. If DatabaseGrowthIncrement is set to zero then
preallocation is disabled. Space for database shadow files is not preallocated.
Also preallocation is disabled if "No reserve" option is set for database.

Note : preallocation also allows to avoid corruptions in out of disk space
condition - in such case there is a big chance that database has enough space
preallocated to operate until administrator makes some disk space available.


Author: Vlad Khorsun,