Interface StatisticsManager

    • Field Detail

      • DATA_TABLE_STATISTICS

        static final int DATA_TABLE_STATISTICS
        Request statistics on data tables.
        See Also:
        Constant Field Values
      • INDEX_STATISTICS

        static final int INDEX_STATISTICS
        Request statistics on indexes.
        See Also:
        Constant Field Values
      • SYSTEM_TABLE_STATISTICS

        static final int SYSTEM_TABLE_STATISTICS
        Request statistics on system tables.
        See Also:
        Constant Field Values
      • RECORD_VERSION_STATISTICS

        static final int RECORD_VERSION_STATISTICS
        Request statistics on record versions.
        See Also:
        Constant Field Values
    • Method Detail

      • getHeaderPage

        void getHeaderPage()
                    throws java.sql.SQLException
        Fetch the database statistics header page.

        The header information is written to this StatisticsManager's logger.

        Throws:
        java.sql.SQLException - if a database access error occurs
      • getDatabaseStatistics

        void getDatabaseStatistics()
                            throws java.sql.SQLException
        Get the full database statistics information, excluding system table information.

        The statistics information is written to this StatisticsManager's logger.

        The listed data includes:

        • statistics header page
        • log statistics
        • index statistics
        • data table statistics

        Invoking this method is equivalent to the default behaviour of gstat on the command-line.

        Throws:
        java.sql.SQLException - if a database access error occurs
      • getDatabaseStatistics

        void getDatabaseStatistics​(int options)
                            throws java.sql.SQLException
        Get specific database statistics.

        The statistics information is written to this StatisticsManager's logger. All invocations of this method will result in the header page and log data being output.

        The following options can be supplied as a bitmask:

        • DATA_TABLE_STATISTICS
        • SYSTEM_TABLE_STATISTICS
        • INDEX_STATISTICS
        • RECORD_VERSION_STATISTICS

        If this method is invoked with 0 as the options value, only the header and log statistics will be output.

        Parameters:
        options - A bitmask combination of DATA_TABLE_STATISTICS, SYSTEM_TABLE_STATISTICS, INDEX_STATISTICS, or RECORD_VERSION_STATISTICS. Can also be 0, which is equivalent to calling method getDatabaseStatistics()
        Throws:
        java.sql.SQLException
      • getTableStatistics

        void getTableStatistics​(java.lang.String[] tableNames)
                         throws java.sql.SQLException
        Get the table statistics.

        The statistics information is written to this StatisticsManager's logger.

        The listed data includes:

        • the primary pointer and index root page numbers
        • number of data pages and their average fill
        • fill distribution

        Invoking this method is equivalent to the behaviour of gstat -t <table name> on the command-line.

        Parameters:
        tableNames - array of table names to analyze.
        Throws:
        java.sql.SQLException - if something went wrong.
      • getDatabaseTransactionInfo

        StatisticsManager.DatabaseTransactionInfo getDatabaseTransactionInfo()
                                                                      throws java.sql.SQLException
        Get transaction information of the database specified in database.
        Returns:
        Database transaction information
        Throws:
        java.sql.SQLException - If database is not specified, or for failures to connect or retrieve information