Database Statistics

The statistics utility can be used to print out information on tables in a database. A detailed description of the statistics utility is described at db_stat . This section describes how to use the utility with a SQL database.

The first step in getting statistics on a table is to find the internal name for the table. The internal table name is table#####, where the number is the rootpage number, which can be retrieved using the following SQL statement:

SELECT rootpage FROM sqlite_master WHERE name='[table name]'; For example, if the root page is 10, the internal table name will be table00010.

In order to run the db_stat utility, first add a DB_CONFIG file to the journal directory. In the file, add the following line:

add_data_dir ..

Then execute the following command in the directory with the database: db_stat -d [file name] -h [journal directory] -s [internal table name]. That command will print out information on the table.