From Norman Dunbar:

  1. Find the database page size:

    The following is all on one line!

    tux> export ISC_USER=sysdba
    tux> gstat -h -password xxxxx employee | grep -i "page [s]ize"
         Page size               4096
    

    So we have a 4KB page size.

  2. Find out how big a table, for example PROJECT, is:

    The following is on two lines for clarity. The '' at the end is not needed if one line only is used!

    tux>  ./gstat employee -password masterkey -t PROJECT | \
          grep -e "data page" -e "buckets"
    
      Data pages: 1, data page slots: 1, average fill: 29%
          Depth: 1, leaf buckets: 1, nodes: 6
          Depth: 1, leaf buckets: 1, nodes: 6
          Depth: 1, leaf buckets: 1, nodes: 6
          Depth: 1, leaf buckets: 1, nodes: 6
    

    The table name appears to need to be in UPPER case.

  3. From the above we can see one data page (for the table data) and one leaf bucket for each index. Add them up and we get 5 data pages at 4K = 20KB running total.

    However, not shown here are any of the tables' "overhead" pages, ditto index "overhead" pages.

Looking at indexes, check the DEPTH for each index, we need to add (DEPTH-1)* PageSize for each index to the running total. In this case, there is nothing to be added as the DEPTH is 1.

We still need to add 1 page for each index though, to cover the index Apex page. So for 4 indices, add 4 * 4K = 16KB extra.

Running Total is now 36 Kb.

For tables, add 1 more page for the pointer page. That's another 4KB in this case, bringing our total up to 40KB.

Now, at this point, I may have lost it! BLOB pages don't seem to be accounted for.

Like this post? Share on: TwitterFacebookEmail


Related Articles


Author

Firebird Community

Published

Category

Gems from Firebird Support list

Tags