Note
This view is available starting with V4.6.3.
Overview
This view displays the number of shared data GC macroblocks deleted per day for each storage type in the current tenant. The view is sorted by the GMT natural day and storage type of the record's GMT_CREATE field. It is visible to user tenants and only displays data for the current tenant.
This view only queries the two types of statistics records: MARK_SWEEP_GC_IN_TABLE_STAT and MARK_SWEEP_GC_OBJECT_STORAGE_STAT. 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, which is fixed in this period. 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 statistics recordsCOUNT(*).The mapping between
STORAGE_TYPEand internal statistics types is as follows:Internal statistics 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: statistics are calculated on a natural day in GMT.
Sample query
You can query the number of shared data GC deletion macroblocks per day for each storage type in the current tenant.
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
References
- View the number of shared data GC-deleted macroblocks per tenant per day by storage type: CDB_OB_SHARED_MACRO_BLOCK_GC_STAT