Note
This view is available starting with V4.0.0.
Overview
Displays information about all auto-increment columns in the cluster. This view is visible only to the system tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| CREATE_TIME | datetime(6) | YES | Creation Time of Auto-Increment Column |
| MODIFY_TIME | datetime(6) | YES | Modified At of Auto-Increment Column |
| TENANT_ID | bigint(20) | NO | Tenant ID |
| AUTO_INCREMENT_KEY | bigint(20) | NO | The KEY of the table where the auto-increment column is located. |
| COLUMN_ID | bigint(20) | NO | Column ID |
| AUTO_INCREMENT_VALUE | bigint(20) unsigned | YES | Next Available Auto-Increment Value |
| SYNC_VALUE | bigint(20) unsigned | NO | The synchronized value, that is, obtained through theInsertThe statement displays the value of the specified auto-increment column, which is greater than its current value. |
Sample query
View all auto-increment columns in the cluster.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_AUTO_INCREMENT;
The query result is as follows:
+----------------------------+----------------------------+-----------+--------------------+-----------+----------------------+------------+
| CREATE_TIME | MODIFY_TIME | TENANT_ID | AUTO_INCREMENT_KEY | COLUMN_ID | AUTO_INCREMENT_VALUE | SYNC_VALUE |
+----------------------------+----------------------------+-----------+--------------------+-----------+----------------------+------------+
| 2025-02-20 14:37:01.322987 | 2025-02-20 14:37:07.197611 | 1002 | 500006 | 16 | 1000001 | 0 |
| 2025-02-20 14:39:18.505040 | 2025-02-20 14:39:18.505040 | 1002 | 500008 | 16 | 1 | 0 |
+----------------------------+----------------------------+-----------+--------------------+-----------+----------------------+------------+
2 rows in set
