Overview
Displays the plan baseline for SQL statements in the SPM of the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| SIGNATURE | bigint(20) unsigned | NO | SQL Unique Identifier Generated by Normalized SQL |
| SQL_HANDLE | varchar(32) | NO | Unique SQL Text |
| SQL_TEXT | longtext | NO | Unnormalized SQL text |
| PLAN_NAME | varchar(128) | NO | Unique text-based plan identifier |
| CREATOR | varchar(128) | NO | User who created this plan baseline |
| ORIGIN | varchar(29) | NO | Methods for creating a plan baseline:
|
| PARSING_SCHEMA_NAME | varchar(128) | NO | This field is not currently supported and defaults to NULL. |
| DESCRIPTION | varchar(500) | YES | Description of the plan baseline |
| VERSION | varchar(256) | NO | Database version at the time of baseline creation |
| CREATED | timestamp(6) | YES | Creation Time of Plan Baseline |
| LAST_MODIFIED | timestamp(6) | YES | Last modification time of the plan baseline |
| LAST_EXECUTED | bigint(20) | NO | Last execution time of the plan baseline |
| LAST_VERIFIED | bigint(20) | NO | Last verification time on the baseline plan |
| ENABLED | varchar(3) | NO | Indicates whether the plan baseline is enabled. Valid values:
|
| ACCEPTED | varchar(3) | NO | Indicates whether the plan baseline is adopted. Valid values:
|
| FIXED | varchar(3) | NO | Specifies whether the plan baseline is fixed. Valid values:
|
| REPRODUCED | varchar(3) | NO | Indicates whether the plan baseline can be reproduced:
|
| AUTOPURGE | varchar(3) | NO | Specifies whether to automatically clean up the plan baseline. Valid values:
|
| ADAPTIVE | varchar(3) | NO | Indicates whether the plan baseline automatically captured by SPM has been adapted:
|
| OPTIMIZER_COST | bigint(20) | NO | Planned Cost Estimated by the Optimizer During Baseline Creation |
| MODULE | varchar(64) | NO | This field is not currently supported and defaults to NULL. |
| ACTION | varchar(64) | NO | This field is not currently supported and defaults to NULL. |
| EXECUTIONS | bigint(20) | NO | Number of Plan Executions at the Time of Baseline Creation |
| ELAPSED_TIME | bigint(20) | NO | Total Time Spent on the Plan at Baseline Creation |
| CPU_TIME | bigint(20) | NO | Total CPU Time of Plans at the Time of Baseline Creation |
| BUFFER_GETS | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
| DISK_READS | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
| DIRECT_WRITES | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
| ROWS_PROCESSED | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
| FETCHES | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
| END_OF_FETCH_COUNT | bigint(0) | NO | This field is not currently supported and defaults to NULL. |
Sample query
View the plan baseline of SQL statements in the SPM of the current tenant.
obclient[oceanbase]> SELECT * FROM oceanbase.DBA_SQL_PLAN_BASELINES\G
The query result is as follows:
*************************** 1. row ***************************
SIGNATURE: 6055243608786114737
SQL_HANDLE: 7F31B924FE5B551C798869E33EA756E6
SQL_TEXT: SELECT * FROM oceanbase.DBA_OB_SPM_EVO_RESULT
PLAN_NAME: 6055243608786114737
CREATOR: oceanbase
ORIGIN: AUTO-CAPTURE
PARSING_SCHEMA_NAME: NULL
DESCRIPTION: NULL
VERSION: 4.3.5.3
CREATED: 2025-04-28 11:47:03.099080
LAST_MODIFIED: 2025-04-28 11:47:03.099080
LAST_EXECUTED: 1745812023098177
LAST_VERIFIED: 1745812023098177
ENABLED: YES
ACCEPTED: YES
FIXED: NO
REPRODUCED: YES
AUTOPURGE: YES
ADAPTIVE: NO
OPTIMIZER_COST: -1
MODULE: NULL
ACTION: NULL
EXECUTIONS: 1
ELAPSED_TIME: 33980
CPU_TIME: 4010
BUFFER_GETS: NULL
DISK_READS: NULL
DIRECT_WRITES: NULL
ROWS_PROCESSED: NULL
FETCHES: NULL
END_OF_FETCH_COUNT: NULL
*************************** 2. row ***************************
SIGNATURE: 17903725222469937441
SQL_HANDLE: BAD211D504FC6E9265F28CFB3CAEF7C9
SQL_TEXT: SELECT sql_handle,plan_name FROM oceanbase.DBA_SQL_PLAN_BASELINES
PLAN_NAME: 17903725222469937441
CREATOR: info
ORIGIN: AUTO-CAPTURE
PARSING_SCHEMA_NAME: NULL
DESCRIPTION: NULL
VERSION: 4.3.5.3
CREATED: 2025-04-28 11:44:16.537033
LAST_MODIFIED: 2025-04-28 11:44:16.537033
LAST_EXECUTED: 1745811856535817
LAST_VERIFIED: 1745811856535817
ENABLED: YES
ACCEPTED: YES
FIXED: NO
REPRODUCED: YES
AUTOPURGE: YES
ADAPTIVE: NO
OPTIMIZER_COST: -1
MODULE: NULL
ACTION: NULL
EXECUTIONS: 1
ELAPSED_TIME: 12067
CPU_TIME: 239
BUFFER_GETS: NULL
DISK_READS: NULL
DIRECT_WRITES: NULL
ROWS_PROCESSED: NULL
FETCHES: NULL
END_OF_FETCH_COUNT: NULL
*************************** 3. row ***************************
SIGNATURE: 12843576483891728377
SQL_HANDLE: C25B16E757E1DEF0EC45BCF0B758D69F
SQL_TEXT: SELECT * FROM t1 WHERE c1 > 1
PLAN_NAME: 12843576483891728377
CREATOR: info
ORIGIN: AUTO-CAPTURE
PARSING_SCHEMA_NAME: NULL
DESCRIPTION: NULL
VERSION: 4.3.5.3
CREATED: 2025-04-28 11:44:09.870337
LAST_MODIFIED: 2025-04-28 11:44:09.870337
LAST_EXECUTED: 1745811849867388
LAST_VERIFIED: 1745811849867388
ENABLED: YES
ACCEPTED: YES
FIXED: NO
REPRODUCED: YES
AUTOPURGE: YES
ADAPTIVE: NO
OPTIMIZER_COST: -1
MODULE: NULL
ACTION: NULL
EXECUTIONS: 1
ELAPSED_TIME: 20769
CPU_TIME: 100
BUFFER_GETS: NULL
DISK_READS: NULL
DIRECT_WRITES: NULL
ROWS_PROCESSED: NULL
FETCHES: NULL
END_OF_FETCH_COUNT: NULL
*************************** 4. row ***************************
SIGNATURE: 2205174570288151559
SQL_HANDLE: D6A97DD0EA1661D4A003AA4AA979B816
SQL_TEXT: SELECT SQL_ID, PLAN_HASH FROM oceanbase.GV$OB_PLAN_CACHE_PLAN_STAT WHERE QUERY_SQL LIKE '%SELECT * FROM test_table WHERE value = 100%'
PLAN_NAME: 2205174570288151559
CREATOR: info
ORIGIN: MANUAL-LOAD
PARSING_SCHEMA_NAME: NULL
DESCRIPTION: NULL
VERSION: 4.3.5.3
CREATED: 2025-04-28 14:51:35.457988
LAST_MODIFIED: 2025-04-28 14:51:35.457988
LAST_EXECUTED: 1745821885403901
LAST_VERIFIED: 1745821885403901
ENABLED: YES
ACCEPTED: YES
FIXED: YES
REPRODUCED: YES
AUTOPURGE: YES
ADAPTIVE: NO
OPTIMIZER_COST: -1
MODULE: NULL
ACTION: NULL
EXECUTIONS: 1
ELAPSED_TIME: 33556
CPU_TIME: 33535
BUFFER_GETS: NULL
DISK_READS: NULL
DIRECT_WRITES: NULL
ROWS_PROCESSED: NULL
FETCHES: NULL
END_OF_FETCH_COUNT: NULL
4 rows in set
References
View the configuration parameters in the SPM of the current tenant: DBA_SQL_MANAGEMENT_CONFIG
For more information about the SPM evolution mechanism, see Execution plan management.