Analyse Data Pages Only
The command to analyse only user tables in the database is:
gstat employee -data >employee.gst
The output from this command lists the user tables in alphabetical order.No indices will be analysed or listed regardless of how many may exist within the database.
Once the report has been completed, the results can be analysed as follows, looking at one table in particular.
CONFIGREVISIONSTORE (213) Primary pointer page: 572, Index root page: 573 Data pages: 2122, data page slots: 2122, average fill: 82% Fill distribution: 0 - 19% = 1 20 - 39% = 0 40 - 59% = 0 60 - 79% = 79 80 - 99% = 2042
The extract, above, from the report begins by displaying the table name — CONFIGREVISIONSTORE
— and the table ID — 213.The table’s ID is actually the column RDB$RELATION_ID
in the system table RDB$RELATIONS
, as the following isql
session shows:
SQL> select rdb$relation_name CON> from rdb$relations CON> where rdb$relation_id = 213; RDB$RELATION_NAME =================================== CONFIGREVISIONSTORE
- Primary pointer page
-
This is the page number, within the database, of the first page with pointers to the data pages of this table.The structure of the database is such that each table has exclusive data pages and a list of those pages is required to be kept somewhere.This statistic gives you the page number for that location.
- Index root page
-
This is the page number where the first page of pointers to the table’s indices can be found within the database.Every table in the database has one page, the index root page, that holds pointers to the apex pages for each individual index.
- Data pages
-
The total number of pages allocated to this table.Because gstat doesn’t connect to the database in a transaction-aware manner, it cannot determine whether any of these pages are old record versions (garbage) or deleted records in currently uncommitted transactions, so the number may be higher than it needs to be as these additional pages are included in the total.
- Data page slots
-
This value should be the same as the number of data pages.It reports on the number of pointers to pages in this table, that are stored in various pointer pages internal to the database.If the numbers differ, it may be down to the garbage that remains uncollected.
- Average fill
-
The calculated space used in each page of the table, on average.The figure includes space utilised by back versions of records in the table.The fill distribution (below) gives more details.
- Fill distribution
-
This section of the report displays a 5-band histogram where each band represents 20% of the space filled in each page.In the example above, we see that this table has a single page that is filled less than 20%, 79 pages are filled to between 60% and 79% while the vast majority, 2042, are filled to between 80% and 99%.