Subject Re: [firebird-support] database growing too much after bulk import
Author Ann W. Harrison
Sergio,
>
> a gstat gives me this about the table. Unfortunatelly I don't know how to
> interpret it. May I have some help in this matter?
>
> STOCK (153)

The table name is STOCK, the RDB$RELATION_ID is 153.

> Primary pointer page: 231, Index root page: 232

Those are internal structures, of great interest to Firebird, but
none to you.

> Average record length: 0.00, total records: 0

That's odd. There are no records in the table. Had you just run
the process that deletes records? Ordinarily, the average record
length would show the average size of a compressed record, and the
total records would show the number of primary records - as opposed
to old versions.

> Average version length: 0.00, total versions: 0, max versions: 0

The "version" information describes old versions, of which there
are none. Max versions is the length of the longest old record
chain - the largest number of old versions for any single record.

> Data pages: 2762, data page slots: 2762, average fill: 39%

OK, there are still 2762 data pages associated with the table and
the same number of slots used on pointer pages. Pointer pages are
the structures used to locate data pages associated with a table.
The average page is 39% full, meaning that garbage collection is
under way and space is being released.

The histogram below shows how many pages fall into which range of
fullness...

> Fill distribution:
> 0 - 19% = 391
> 20 - 39% = 1115
> 40 - 59% = 1075
> 60 - 79% = 181
> 80 - 99% = 0
>

It would be more interesting to see the gstat output after the
records are loaded, and also the related indexes.

Cheers,

Ann