FirebirdSQL logo

-⁠?

This switch displays the usage information of gstat.

Note
Introduced in Firebird 2.5.

-⁠D[ATA]

Specifying this switch causes gstat to analyse all user tables of the specified database.Indices are not analysed unless [gstat-cmdline-index] is also specified.

When combined with [gstat-cmdline-system], the system tables are analysed in addition to the user tables.

If [gstat-cmdline-table] is also specified, analysis is restricted to the specified tables.

This switch is implied by [gstat-cmdline-all].

-⁠E[NCRYPTION]

Displays statistics on how many database pages are encrypted.This can, for example, be used to track the progress of encrypting or decrypting a database.

For example, getting encryption statistics on a non-encrypted employee database:

C:\Program Files\Firebird\Firebird5.0>gstat -u sysdba -e employee

Database "C:\Program Files\Firebird\Firebird5.0\examples\empbuild\employee.fdb"
Gstat execution time Fri Feb 23 12:36:37 2024

Database header page information:
[..]

Data pages: total 122, encrypted 0, non-crypted 122
Index pages: total 99, encrypted 0, non-crypted 99
Blob pages: total 0, encrypted 0, non-crypted 0
Generator pages: total 1, encrypted 0, non-crypted 1
Gstat completion time Fri Feb 23 12:36:37 2024

And on an encrypted database:

C:\Program Files\Firebird\Firebird5.0>gstat -u sysdba -e crypttest

Database "C:\DB\encrypteddb.fdb"
Gstat execution time Fri Feb 23 12:37:55 2024

Database header page information:
[..]

Data pages: total 82, encrypted 82, non-crypted 0
Index pages: total 60, encrypted 60, non-crypted 0
Blob pages: total 0, encrypted 0, non-crypted 0
Generator pages: total 1, encrypted 1, non-crypted 0
Gstat completion time Fri Feb 23 12:37:55 2024

This switch cannot be combined with most other switches, specifically it will report an error when combined with [gstat-cmdline-all], [gstat-cmdline-data], [gstat-cmdline-header], [gstat-cmdline-index], [gstat-cmdline-record], [gstat-cmdline-system], or [gstat-cmdline-table].

Note
Introduced in Firebird 3.0.

-⁠H[EADER]

This switch displays statistics about the database itself, or more specifically, information from the database header page, and then exits.The header information is also displayed when any other switch is used — so you always get database header details in your output.

Although other switches display the database header as well, it is not possible to combine -⁠h[eader] with the other switches (except [gstat-cmdline-z] and authentication switches).

Note

The header information is read by direct access to the database file, and contrary to other switches, -⁠h[eader] does not require authentication.