Undo System Functions

  • gs_undo_meta(type, zoneId, location)

    Description: Specifies metadata of each module in the undo system.

    Parameter description:

    • type (metadata type)

      The value 0 indicates the metadata corresponding to Undo Zone(Record).

      The value 1 indicates the metadata corresponding to Undo Zone(Transaction Slot).

      The value 2 indicates the metadata corresponding to Undo Space(Record).

      The value 3 indicates the metadata corresponding to Undo Space(Transaction Slot).

    • zoneId (undo zone ID)

      The value –1 indicates the metadata of all undo zones.

      The value range 0–1024 x 1024 indicates the metadata of the corresponding zone ID.

    • location (read location)

      The value 0 indicates that data is read from the current memory.

      The value 1 indicates that data is read from a physical file.

    Return type: record

  • gs_undo_translot(location, zoneId)

    Description: Specifies transaction slot information of the undo system.

    Parameter description:

    • location (read location)

      The value 0 indicates that data is read from the current memory.

      The value 1 indicates that data is read from a physical file.

    • zoneId (undo zone ID)

      The value –1 indicates the metadata of all undo zones.

      The value range 0–1024 x 1024 indicates the metadata of the corresponding zone ID.

    Return type: record

  • gs_stat_undo()

    Description: Undo statistics.

    Return type: record

    Table 1 gs_stat_undo parameters

    Category

    Parameter Name

    Type

    Description

    Output parameter

    curr_used_zone_count

    uint32

    Number of used undo zones.

    Output parameter

    top_used_zones

    text

    Information about the first three undo zones with the maximum usage. The output format is as follows:

    (zoneId1:Used size; zoneId2:Used size; zoneId3:Used size).

    Output parameter

    curr_used_undo_size

    uint32

    Total size of the undo tablespace that is being used. The unit is MB.

    Output parameter

    undo_threshold

    uint32

    Calculation result of the value of the GUC parameter undo_space_limit_size x 80%. The unit is MB.

    Output parameter

    oldest_xid_in_undo

    uint64

    XID of the transaction recycled to the undo space. The undo records generated by the transaction whose XID is smaller than the value of XID are recycled.

    Output parameter

    oldest_xmin

    uint64

    Oldest active transaction.

    Output parameter

    total_undo_chain_len

    int64

    Total length of all accessed undo chains.

    Output parameter

    max_undo_chain_len

    int64

    Maximum length of the accessed undo chain.

    Output parameter

    create_undo_file_count

    uint32

    Number of created undo files.

    Output parameter

    discard_undo_file_count

    uint32

    Number of deleted undo files.

  • gs_undo_record(undoptr)

    Description: Undo record resolution.

    Parameter description:

    • undoptr (undo record pointer)

    Return type: record

Feedback
编组 3备份
    openGauss 2024-05-07 00:46:52
    cancel