Updated on 2024-08-20 GMT+08:00

DBE_COMPRESSION

Interface Description

Evaluates the sampling compression rate of a specified data object or obtains the compression type of a specified row of data based on the input parameters.

Table 1 DBE_COMPRESSION

Interface

Description

GET_COMPRESSION_RATIO

Evaluates the sampling compression ratio of a specified data object based on input parameters.

GET_COMPRESSION_TYPE

Obtains the compression type of data in a specified row based on input parameters.

The GET_COMPRESSION_TYPE interface supports only DNs in the distributed database.

  • DBE_COMPRESSION.GET_COMPRESSION_RATIO

    Evaluates the sampling compression rate of a specified data object based on the input parameters. The prototype is as follows:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    DBE_COMPRESSION.GET_COMPRESSION_RATIO (
    scratchtbsname   IN  TEXT,
    ownname          IN  TEXT,
    objname          IN  TEXT,
    subobjname       IN  TEXT,
    comptype         IN  INTEGER,
    blkcnt_cmp       OUT INTEGER,
    blkcnt_uncmp     OUT INTEGER,
    row_cmp          OUT INTEGER,
    row_uncmp        OUT INTEGER,
    cmp_ratio        OUT NUMBER,
    comptype_str     OUT VARCHAR2,
    sample_ratio     IN  NUMBER  DEFAULT 20, 
    objtype          IN  INTEGER DEFAULT 1);
    
    Table 2 DBE_COMPRESSION.GET_COMPRESSION_RATIO parameters

    Parameter

    Description

    scratchtbsname

    Tablespace to which a data object belongs.

    ownname

    Data object owner (schema to which the data object belongs).

    objname

    Data object name.

    subobjname

    Name of a data subobject.

    comptype

    Compression type. The options are as follows:
    • 1: uncompressed.
    • 2: advanced compression.

    blkcnt_cmp

    Number of pages occupied by sampled rows after compression.

    blkcnt_uncmp

    Number of pages occupied by sampled rows before compression.

    row_cmp

    Number of compressed rows on a single page.

    row_uncmp

    Number of uncompressed rows on a single page.

    cmp_ratio

    Compression ratio.

    comptype_str

    Character string of the compression type.

    sample_ratio

    Sampling rate.

    objtype

    Object type. The options are as follows:
    • 1: table object.
  • DBE_COMPRESSION.GET_COMPRESSION_TYPE

    This interface is used to obtain the compression type of a specified row based on input parameters. This interface is an O&M interface and does not check the visibility. That is, if the input CTID is a deleted row, this interface still returns the latest status of the current row on the page. The prototype is as follows:

    1
    2
    3
    4
    5
    6
    DBE_COMPRESSION.GET_COMPRESSION_TYPE (
    ownname          IN  TEXT,
    tablename        IN  TEXT,
    ctid             IN  INTEGER,
    subobjname       IN  TEXT    DEFAULT NULL,
    comptype         OUT INTEGER);
    
    Table 3 DBE_COMPRESSION.GET_COMPRESSION_TYPE parameters

    Parameter

    Description

    ownname

    Data object owner (schema to which the data object belongs).

    tablename

    Data object name.

    ctid

    CTID of the target row.

    subobjname

    Name of a data subobject.

    comptype

    Compression type. The options are as follows:
    • 1: uncompressed.
    • 2: advanced compression.