Subject Re: [firebird-support] Space consuming test
Author Ivan Prenosil
>I have made interesting test:
> Create DB
> Create Table T1 ( FIELD1 VARCHAR(1600) )
> insert 2 mil records of NULL. (Commit every 100.000 recs)
> Size became 141 MB
> And that is :
> 1 record
> 141 000 / 2.000.000 ~ 0.0705 KB or ~ 70,5 bytes. So, FB is using 70
> bytes of data for I dont know what.
> (As far as I remember 70 bytes , it would be ~ 35 chars)

Firebird's rle algorithm will compress 1600 bytes into 28 bytes.
Each row has some overhead (informations about transaction-id,
format number, delete flag, null flags, alignment, etc.)
Each data page has some overhead (checksum, relation-id,
array of pointers for records/record fragments, etc.)
When inserting data, the page is not filled completely,
some space will be left so subsequent updates will be faster
(this reserving of space can be switched off).
There are lot of other necessary structures - pointer pages
so that data pages are well organized, transaction inventory
pages, system tables, etc.

And the most space volume is in fact wasted by inserting
two millions of worthless data :-)