Subject Re: [firebird-support] Maximum number of rows in Firebird 2.1 and up (is it 1099511627776 records ?)
Author Ann Harrison
On Sat, Apr 16, 2011 at 1:15 PM, lmatusz <matuszewski.lukasz@...> wrote:
> We all know that documentation states that record enumeration is expanded to 40-bits (64-bits internally).
>
> If these statements above are true then maximum number of records (rows) are:
> 2^40 which is 1099511627776 records (above 1 Tera records).
>
> I am asking this question because the docs states (or faq) it is above 16 G records (and not measured beyond) (2^34)
>

The record number space is not dense. There are holes - numbers which are never
used. The record number decomposes into the sequence number of a pointer page
for the table, the offset of a data pages number on that page, and the
offset of a
pointer/length pair on the data page. To make that work, there have
to be enough
bits reserved for the offset on the data page to allow as many records
as can possibly
fit on a page. Since records can be very short, that's quite a few
bits. But most
records are bigger than the minimum size, so some of the bits are wasted.

Good luck,

Ann