Updated on 2025-05-29 GMT+08:00

DBE_HEAT_MAP

API Description

Returns information such as the last modification time of a row in the target data block based on the input parameters. The information is used to browse the basis for determining cold and hot rows. This API is an O&M API and has no visibility check. That is, if the input CTID is a deleted row, this API still returns the latest status of the current row on the page.

Table 1 DBE_HEAT_MAP

API

Description

ROW_HEAT_MAP

Obtains information such as the last modification time of a row based on the schema to which the object belongs, data object name, data object partition name, and CTID.

  • DBE_HEAT_MAP.ROW_HEAT_MAP

    Obtains information such as the last modification time of a row based on the schema to which the object belongs, data object name, data object partition name, and CTID. The prototype is as follows:

    1
    2
    3
    4
    5
    6
    DBE_HEAT_MAP.ROW_HEAT_MAP(
    OWNER           IN VARCHAR2,
    SEGMENT_NAME    IN VARCHAR2,
    PARTITION_NAME  IN VARCHAR2     DEFAULT NULL,
    CTID            IN TEXT,
    V_DEBUG         IN BOOL         DEFAULT FALSE);
    
    Table 2 DBE_HEAT_MAP.ROW_HEAT_MAP parameters

    Parameter

    Description

    OWNER

    Schema to which a data object belongs.

    SEGMENT_NAME

    Data object name.

    PARTITION_NAME

    Data object partition name. This parameter is optional. The default value is NULL.

    CTID

    ctid of the target row, that is, block_id or row_id.

    V_DEBUG

    Debugging. Debug logs are recorded.

    Table 3 Output parameters of DBE_HEAT_MAP.ROW_HEAT_MAP

    Parameter

    Description

    OWNER

    Owner of a data object.

    SEGMENT_NAME

    Data object name.

    PARTITION_NAME

    Name of a data object partition. This parameter is optional.

    TABLESPACE_NAME

    Name of the tablespace to which data belongs.

    FILE_ID

    ID of the absolute file to which a row belongs.

    RELATIVE_FNO

    ID of the relative file to which a row belongs. (GaussDB does not have this logic. Therefore, the value is the same as the preceding value.)

    CTID

    ctid of a row, that is, block_id or row_id.

    WRITETIME

    Last modification time of a row.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
gaussdb=# ALTER DATABASE set ilm = on;
gaussdb=# CREATE Schema HEAT_MAP_DATA;
gaussdb=# SET current_schema=HEAT_MAP_DATA;

gaussdb=# CREATE TABLESPACE example1 RELATIVE LOCATION 'tablespace1';
gaussdb=# CREATE TABLE HEAT_MAP_DATA.heat_map_table(id INT, value TEXT) TABLESPACE example1;
gaussdb=# INSERT INTO HEAT_MAP_DATA.heat_map_table VALUES (1, 'test_data_row_1');

gaussdb=# SELECT * from DBE_HEAT_MAP.ROW_HEAT_MAP(
    owner         =>  'heat_map_data',
    segment_name  =>  'heat_map_table',
    partition_name  => NULL,
    ctid          =>  '(0,1)');
     owner     |  segment_name  | partition_name | tablespace_name | file_id | relative_fno | ctid  | writetime 
---------------+----------------+----------------+-----------------+---------+--------------+-------+-----------
 heat_map_data | heat_map_table |                | example1        |   17291 |        17291 | (0,1) | 
(1 row)