Firebird Documentation Index → Inside a Firebird Database → Write Ahead Log Page - Type 0x0a |
Every database has one Write Ahead Log page (WAL) which is currently always located at page 2.
Discussions have taken place on the Firebird development mailing list on removing this page altogether as it is not used and simply wastes space that could be better used elsewhere. From Firebird 3.0 it is likely that there will not be a WAL page in any new databases.
The C code representation of the WAL page is:
struct log_info_page { pag log_header; SLONG log_flags; ctrl_pt log_cp_1; ctrl_pt log_cp_2; ctrl_pt log_file; SLONG log_next_page; SLONG log_mod_tip; SLONG log_mod_tid; SLONG log_creation_date[2]; SLONG log_free[4]; USHORT log_end; UCHAR log_data[1]; };
As this structure is no longer in use within the database, it is effectively, a wasted page. Looking at a hexdump of the WAL page in a new database, we see the following:
tux> ./fbdump ../blank.fdb -p 2 FBDUMP 1.00 - Firebird Page Dump Utility DATABASE PAGE DETAILS - Page 2 Page Type: 10 PAGE DATA Flags: 0x00000000 Log Control Point 1: Sequence: 0 Offset: 0 P_offset: 0 Fn_Length: 0 Log Control Point 2: Sequence: 0 Offset: 0 P_offset: 0 Fn_Length: 0 Current File: Sequence: 0 Offset: 0 P_offset: 0 Fn_Length: 0 Next Page: 0 Mod Tip: 0 Mod Transaction Id: 0 Creation Date: COMING SOON Log Free Space: 0 0 0 0 Log End: 0
The remainder of the page is filled with binary zeros.
Because the WAL is no longer in use, and may even be dropped completely from Firebird 3.0 onwards, it will not be discussed further.
Firebird Documentation Index → Inside a Firebird Database → Write Ahead Log Page - Type 0x0a |