firebird.lib.gstat¶
Enums¶
- class firebird.lib.gstat.DbAttribute(value)[source]¶
Bases:
EnumDatabase attributes stored in header page clumplets.
- ACTIVE_SHADOW = 'active shadow'¶
- BACKUP_LOCK = 'backup lock'¶
- BACKUP_MERGE = 'backup merge'¶
- BACKUP_WRONG = 'wrong backup state'¶
- NO_RESERVE = 'no reserve'¶
- NO_SHARED_CACHE = 'shared cache disabled'¶
- READ_ONLY = 'read only'¶
- SHUTDOWN_FULL = 'full shutdown'¶
- SHUTDOWN_MULTI = 'multi-user maintenance'¶
- SHUTDOWN_SINGLE = 'single-user maintenance'¶
- WRITE = 'force write'¶
Dataclasses¶
Classes¶
- class firebird.lib.gstat.StatDatabase[source]¶
Bases:
objectParses and holds Firebird database statistics produced by the gstat utility.
This is the main class for interacting with gstat output. Instantiate it and use the
parse()orpush()methods to feed it gstat output lines. Parsed statistics are stored in the instance’s attributes and thetablesandindicescollections.- has_encryption_stats() bool[source]¶
Returns True if instance contains information about database encryption.
- Return type:
- has_index_stats() bool[source]¶
Returns True if instance contains information about indices.
- Return type:
- has_row_stats() bool[source]¶
Returns True if instance contains information about table rows.
- Return type:
- has_system() bool[source]¶
Returns True if instance contains information about system tables.
- Return type:
- has_table_stats() bool[source]¶
Returns True if instance contains information about tables.
Important
This is not the same as check for empty
tableslist. When gstat is run with-iwithout-doption,tableslist contains instances that does not have any other information about table but table name and its indices.- Return type:
- parse(lines: Iterable[str]) None[source]¶
Parses gstat output from an iterable source.
Processes all lines from the iterable and finalizes parsing.
- push(line: str | STOP) None[source]¶
Pushes a single line (or STOP sentinel) into the parser state machine.
This method processes one line of gstat output at a time, updating the internal state and populating statistics attributes. Call with the
STOPsentinel after the last line to finalize processing (e.g., convert distributions, freeze lists).- Parameters:
line (str | STOP) – Single gstat output line, or the
firebird.base.types.STOPsentinel.- Return type:
None
- attributes: list[DbAttribute]¶
Database attributes
- class firebird.lib.gstat.StatTable[source]¶
Bases:
objectStatistics for a single database table, populated from gstat output.
Attributes are populated by the
StatDatabaseparser. Default values areNoneor 0 until parsed from the input.- distribution: FillDistribution | None¶
Data page fill distribution statistics. Final type is
FillDistribution.
- indices: DataList[StatIndex]¶
Indices belonging to table. Items are
weakref.proxytoStatIndex.
- class firebird.lib.gstat.StatIndex(table)[source]¶
Bases:
objectStatistics for a single database index, populated from gstat output.
Instances are linked to their parent
StatTablevia a weak reference. Attributes are populated by theStatDatabaseparser.- Parameters:
table (ProxyType)
- distribution: FillDistribution | None¶
Index page fill distribution statistics