- All Superinterfaces:
AttachmentProperties
,BaseProperties
,ServiceConnectionProperties
,ServiceManager
- All Known Implementing Classes:
FBStatisticsManager
StatisticsManager
is responsible for replicating the functionality of the gstat
command-line tool.
This functionality includes:
- Retrieving data table statistics
- Retrieving the database header page
- Retrieving index statistics
- Retrieving database logging information
- Retrieving statistics for the data dictionary
- Author:
- Gabriel Reid
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Request statistics on data tables.static final int
Request statistics on indexes.static final int
Request statistics on record versions.static final int
Request statistics on system tables. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Get the full database statistics information, excluding system table information.void
getDatabaseStatistics
(int options) Get specific database statistics.Get transaction information of the database specified indatabase
.void
Fetch the database statistics header page.void
getTableStatistics
(String[] tableNames) Get the table statistics.Methods inherited from interface org.firebirdsql.jaybird.props.AttachmentProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEnableProtocol, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSocketFactory, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEnableProtocol, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSocketFactory, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
Methods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
Methods inherited from interface org.firebirdsql.jaybird.props.ServiceConnectionProperties
getExpectedDb, getServiceName, setExpectedDb, setServiceName
Methods inherited from interface org.firebirdsql.management.ServiceManager
getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setDatabase, setHost, setLogger, setPort, setWireCryptAsEnum
-
Field Details
-
DATA_TABLE_STATISTICS
static final int DATA_TABLE_STATISTICSRequest statistics on data tables.- See Also:
-
INDEX_STATISTICS
static final int INDEX_STATISTICSRequest statistics on indexes.- See Also:
-
SYSTEM_TABLE_STATISTICS
static final int SYSTEM_TABLE_STATISTICSRequest statistics on system tables.- See Also:
-
RECORD_VERSION_STATISTICS
static final int RECORD_VERSION_STATISTICSRequest statistics on record versions.- See Also:
-
-
Method Details
-
getHeaderPage
Fetch the database statistics header page.The header information is written to this
StatisticsManager
's logger.- Throws:
SQLException
- if a database access error occurs
-
getDatabaseStatistics
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:
SQLException
- if a database access error occurs
-
getDatabaseStatistics
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 theoptions
value, only the header and log statistics will be output.- Parameters:
options
- A bitmask combination ofDATA_TABLE_STATISTICS
,SYSTEM_TABLE_STATISTICS
,INDEX_STATISTICS
, orRECORD_VERSION_STATISTICS
. Can also be0
, which is equivalent to calling methodgetDatabaseStatistics()
- Throws:
SQLException
-
getTableStatistics
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:
SQLException
- if something went wrong.
-
getDatabaseTransactionInfo
Get transaction information of the database specified indatabase
.- Returns:
- Database transaction information
- Throws:
SQLException
- Ifdatabase
is not specified, or for failures to connect or retrieve information- Since:
- 3
-