Subject Re: [firebird-support] Re: Maximum number of rows in Firebird 2.1 and up (is it 1099511627776 records ?)
Author Ann Harrison
On Sun, Apr 17, 2011 at 6:09 PM, lmatusz <matuszewski.lukasz@...> wrote:
> Sorry for bothering... but i would like mathematical equation for max number of rows/records.

The number of records in a table depends on the size of the records.
The larger the records,
the more record numbers are wasted. Here's some of the relevant code
from pag.cpp

/* Compute the number of data pages per pointer page. Each data page
requires a 32 bit pointer and a 2 bit control field. */

dbb->dbb_dp_per_pp = (dbb->dbb_page_size - OFFSETA(pointer_page*, ppg_page))
* 8 / (BITS_PER_LONG + 2);

/* Compute the number of records that can fit on a page using the
size of the record index (dpb_repeat) and a record header. This
gives an artificially high number, reducing the density of db_keys. */

dbb->dbb_max_records = (dbb->dbb_page_size - sizeof(data_page)) /
(sizeof(data_page::dpg_repeat) + OFFSETA(RHD, rhd_data));

Best regards,