.. _stat:

Database statistic
===================

Tool displays database statistics and also allows you to compare the results of analysing two databases.

.. figure:: img/stat.png

    Database statistic

Statistical collection formats:

* ``Default`` - analysis of the whole database, output is similar to execution of ``gstat`` without options;
* ``Tables`` - data page statistics, output is similar to ``gstat -data``;
* ``Indices`` - analyses indexes, output similar to ``gstat -index``;
* ``Record Versions`` - adds statistics on average record lengths, number of versions and information about ``BLOB``;
* ``System Objects`` - analyses system tables and indexes;
* ``Header page`` - static database data, output is similar to ``gstat -header``;
* ``Only selected tables`` - analysis of selected tables, the parameter is available if a connection to the selected database is established.

Statistic is displayed in a separate tab:

..  figure:: img/stat_out.png

    Statistics

See :ref:`gstat` for a detailed description of the values to be collected.

Comparing statistics of two databases
----------------------------------------

For comparing the statistics of two databases, collect statistics for the second database and click the ``Compare`` button.

The ``Text`` tab will display text output of statistics:

.. figure:: img/compare_stat_text.png

    Textual output of statistics

In ``Tables``, ``Indices`` and ``Tablespaces`` tabs, column values show difference between result of first and second database.  

.. figure:: img/compare_stat_sql.png

    Result of statistics comparison

Green colour indicates what is in both databases.
Red colour indicates tables and indexes that are present in the first database but absent in the second database.