Overview
Displays the memory statistics of the current tenant on the current node.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| SVR_IP | varchar(46) | NO | Server IP Address |
| SVR_PORT | bigint(20) | NO | Server Port Number |
| CTX_NAME | varchar(256) | NO | Name of the CTX to Which Memory Belongs |
| MOD_NAME | varchar(256) | NO | Name of the module to which the memory belongs |
| COUNT | decimal(20,0) | NO | The difference between memory allocation and release, that is, the number of memory units currently in use by this module. |
| HOLD | decimal(20,0) | NO | The memory size currently occupied by this module |
| USED | decimal(20,0) | NO | The memory usage of the module, in bytes. |
CTX_NAME field values
The following table describes the common memory context variables and their meanings:
CTX_NAME |
Description |
|---|---|
| DEFAULT_CTX_ID | Indicates the context ID of the unpartitioned memory collection. |
| MEMSTORE_CTX_ID | Represents the user's MemTable data context ID. |
| TRANS_CTX_MGR_ID | Transaction Context ID |
| PLAN_CACHE_CTX_ID | Execution plan cache context ID. |
| GLIBC | Indicates the memory allocated using the Glibc Malloc interface. |
| CO_STACK | Represents the memory of the thread execution stack. |
| KVSTORE_CACHE_ID | Represents the dynamic scalable cache ID. |
| META_OBJ_CTX_ID | Represents the memory for storing metadata, such as macroblock meta. |
| TX_CALLBACK_CTX_ID | Represents the transaction callback context ID. It is used to record some modifications during transaction execution, so that the corresponding data can be located for operations during transaction commit or rollback. |
| LOB_CTX_ID | Indicates the allocator ID in the OBlobManager. |
| PS_CACHE_CTX_ID | means PREPARE stmt_name FROM preparable_stmt The cache ID of the statement. |
| TX_DATA_TABLE | Represents a transaction data table. It stores the status of completed transactions and is used for queries in scenarios such as minor compactions, uncommitted transactions, and FAST COMMIT. |
| MDS_DATA_ID | Memory ID of Multi-source Data |
| LIBEASY | Indicates the memory of the network framework (EASY). |
| LOGGER_CTX_ID | Indicates the program log memory context ID. |
| RPC_CTX_ID | Represents the memory context ID of the RPC framework. |
| PKT_NIO | Represents the memory of the network framework (pkt_nio). |
| SCHEMA_SERVICE | Represents the memory for schema metadata, such as tables and databases. |
Mapping between CTX_NAME and MOD_NAME
The common correspondence between CTX_NAME and MOD_NAME is as follows:
CTX_NAME |
MOD_NAME |
TENANT |
|---|---|---|
| DEFAULT_CTX_ID |
|
ALL |
|
500 | |
| SQL_EXEC_CTX_ID |
|
ALL |
| WORK_AREA |
|
|
| PLAN_CACHE_CTX_ID |
|
|
| TRANS_CTX_MGR_ID |
|
|
| TX_CALLBACK_CTX_ID | MemtableCallbac: the module related to memory table callback. | |
| REPLAY_STATUS_CTX_ID | ReplayStatus: the module related to the replay status. | |
| CO_STACK | CO_STACK: Coroutine stack-related modules | 500 |
| STORAGE_LONG_TERM_META_CTX_ID |
|
|
| STORAGE_SHORT_TERM_META_CTX_ID |
|
|
| ALL | OB_COMMON_ARRAY: OceanBase common array | ALL |
Impact of common SQL operations on memory CTX
In OceanBase AI Database, each SQL execution or operation corresponds to a specific CTX. Due to differences in data volume and operation complexity, the memory used by a CTX may lead to increased memory consumption. The following are some common SQL executions or operations that may cause the usage of memory for certain CTXs to increase:
Sorting large volumes of data (ORDER BY, GROUP BY, etc.): Sorting operations require loading data into memory for processing, which may lead to increased memory usage in the PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID contexts.
Aggregation of large data volumes (SUM, AVG, MAX, MIN, etc.): Aggregation operations require loading data into memory for computation, which may lead to increased memory usage in the PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID contexts.
Connections (JOINs) with large data volumes: The join operation requires loading data into memory for matching, which may lead to increased memory usage in the PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID contexts.
Queries with large data volumes (SELECT): The query operation needs to load data into memory for filtering and sorting, which may lead to increased memory usage in PLAN_CACHE_CTX_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.
Writing large volumes of data (INSERT, UPDATE, DELETE, etc.): Write operations require transaction management and processing, which may lead to increased memory usage in TRANS_CTX_MGR_ID, MEMSTORE_CTX_ID, and DEFAULT_CTX_ID.
Logs with large data volumes (such as REDO, UNDO, and BINLOG logs): Log operations require loading data into memory for processing, which may lead to increased memory usage in the TRANS_CTX_MGR_ID, DEFAULT_CTX_ID, LOB_CTX_ID, and TX_DATA_TABLE variables.