Subject Re: How to decide when a new secondary file is required
Author gkrishna63 <gkrishna@jlmatrix.com>
--- In ib-support@yahoogroups.com, "Ann W. Harrison" <aharrison@i...>
wrote:
> That's not going to be completely reliable since only pointer
> pages, TIPs, index roots, and generator pages show up in RDB$PAGES.
> The much more popular index and data pages do not. There's a
> database info parameter, isc_info_allocation, that will give the
> number of pages currently in use.
>
>
> Regards,
>
> Ann
> www.ibphoenix.com
> We have answers.
Ann,
I am trying to use that( Hmm Assumption here is that
TIBDatabaseInfo.Allocation is returning isc_info_allocation).

However isc_info_allocation seems to return strange values if there
is an EXTRA secondary file. When I say extra i mean that there is a
secondary file into which no data is being written i.e. primary file
is not full or previous secondary file is not full.

Let me put down the figures that I had mentioned in the original mail
(Is this prechance a bug)

If there is only on file and the actual file size is 1470 KB
Then the number of allocated pages is 736 and the page size is 2048
So 736*(2048 / 1024) gives us total database file size as 1472 KB

This results in ~ correct figure

Suppose there are two files First file size 1026 Kb and second file
is 448 for a total of 1026 + 448 = 1474 KB
Then the number of allocated pages is 739 and the page size is 2048
Then total database file size become 1478 KB (739*2049/1024)

These results are also ~ correct

Suppose there are three files. Only the main file and first secondary
file has any data. The second secondary file is not used because it
has them minimum size of 4KB.

That is the file sizes are 1026 KB, 448 KB and 4 KB for a total of
1026 +448 + 4 = 1478 KB

But number of allocated pages is 1026 and the page size is 2048 Hence
database size should be 2053 KB
i.e. 1026 *2048/1024
But allocated pages should be roughly 740 or 74 pages

This is 3 test cases.
I have an excel spreadsheet full of figures with something like 100
test cases. number of allocated pages seem to count some extra pages
when there is a secondary file which has no data in it.

Any comments
GK