Note
This view is available starting with V4.6.3.
Overview
This view displays the number of shared data GC-deleted macroblocks per day for each storage type in the current tenant. It groups the records by the GMT day and storage type of the GMT_CREATE column, aggregating the two new types of statistics from the __all_virtual_shared_gc_task_history table. It is visible to user tenants and only displays data for the current tenant.
This view only queries the MARK_SWEEP_GC_IN_TABLE_STAT and MARK_SWEEP_GC_OBJECT_STORAGE_STAT statistics records. It does not read or deserialize the original MacroBlockID lists in the MARK_SWEEP_GC records, thereby avoiding query timeouts caused by expanding a large number of MacroBlockIDs during the query.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| STAT_DATE | date | NO | Statistics Records GMT_CREATE The GMT natural day to which it belongs. |
| GC_TYPE | varchar(128) | NO | GC Type, Fixed Return in This Issue MARK_SWEEP_GC. |
| STORAGE_TYPE | varchar(32) | NO | Storage type:
|
| DELETED_MACRO_BLOCK_COUNT | bigint(20) | NO | The number of MacroBlockIDs that have completed the deletion process for this storage type by the current tenant on the day. |
| DELETED_MACRO_BLOCK_SIZE | bigint(20) | YES | Total size of deleted macroblocks, in bytes. This field is reserved and always returns a fixed value. NULL. |
Usage instructions
The value of
DELETED_MACRO_BLOCK_COUNTis the cumulative sum of theVALUEfields in the statistics records, that is,SUM(CAST(VALUE AS UNSIGNED)), not the count of recordsCOUNT(*).The mapping between
STORAGE_TYPEand internal statistics types is as follows:Internal storage typeViewSTORAGE_TYPEMARK_SWEEP_GC_IN_TABLE_STATIN_TABLEMARK_SWEEP_GC_OBJECT_STORAGE_STATOBJECT_STORAGEDELETED_MACRO_BLOCK_SIZEalways returnsNULLinstead of0in this version to prevent users from mistakenly assuming the deleted size is 0.STAT_DATE: counts by natural day in GMT.
Sample query
Query the number of macroblocks deleted by GC per storage type for the current tenant on a daily basis.
SELECT *
FROM oceanbase.DBA_OB_SHARED_MACRO_BLOCK_GC_STAT
ORDER BY STAT_DATE, STORAGE_TYPE;
The query result is as follows:
+------------+---------------+----------------+---------------------------+--------------------------+
| STAT_DATE | GC_TYPE | STORAGE_TYPE | DELETED_MACRO_BLOCK_COUNT | DELETED_MACRO_BLOCK_SIZE |
+------------+---------------+----------------+---------------------------+--------------------------+
| 2026-08-18 | MARK_SWEEP_GC | IN_TABLE | 120 | NULL |
| 2026-08-18 | MARK_SWEEP_GC | OBJECT_STORAGE | 380 | NULL |
+------------+---------------+----------------+---------------------------+--------------------------+
2 rows in set