Subject RE: [firebird-support] Max. # of records in a table.
Author Leyne, Sean
Michael,

> Earlier today I asked a question about max. # of records in a single
> table. According to the docs it can hold 2 to the power of 32.
> This is a lot.
>
> But according to the link Martijn posted earlier
>
> http://www.ib-aid.com/interbase/firebird/bug/research.html
>
> This is far from true.
>
> My question is then - Does the calculation on that specific page hold
> water ?
> I.e. Can I use it to calculate my own "worst case" ?
>
> Assuming a table contains records, that they are not packed in any
> way, and every field is filled to the max.
> I can then calculate my MAX.recordsize.
>
> Knowing this - I can actually calculate when I hit the limit (as in
> worst case senario, sinse every records seldom is fully filled, and
> AFAIK the records are stored packed) !

I am not aware of any way to calculate an absolute number.

I can say that prior to Firebird v2.0, each record had a 32 bit DB$KEY
value. The 32 bits were not a true counter but a 'reference' value
which incorporated information concerning the table number, the page
number and then the page offset. All told the maximum size of a table
worked out to be 30 to 40 GB in size.

In v2.0 the DB$KEY has been increased to a 40 bit value. The additional
bits were added to allow for a table to support more pages, thus more
records. This means that the maximum size of a table (if my reasoning
is right) should now be 30^8 or 40^8 GB in size.


Sean