Subject Re: [firebird-support] Generator Performance
Author Norman Dunbar
On 26/09/11 17:06, Ann Harrison wrote:

>> Is there a way of finding out how many pages are used to store a given
>> table? Or documentation about how the mapping from tables to memory and
>> disk pages are implemented on firebird?
Maybe
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/Firebird-Internals.pdf
might help, it's a work in [slow] progress though. :-(

HTML version is on-line at
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/fb-internals.html.


> Pretty simple. If you care about detail, look at ods.h for the size of the
> PAG structure and the exact layout of a generator page. For a rough
> approximation of the number of generators on a page, divide the page size by
> 8.
If I remember, (page-size-32)/8 gives the maximum number of sequences on
a page. For a 4K page that's 507. There is also a maximum of 32,767
sequences per database.

> Note that this algorithm works ONLY for generators which are not normal
> table data. Figuring out how many data records fit on a page is an advanced
> exercise.
http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/fbint-page-5.html
might help explain the difficulties - think Run Length Encoding and
NULLs etc.


Cheers,
Norm.


--
Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
Pudsey
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767