Overview
gv$plan_cache_plan_stat records the status of each object that is cached by the current tenant in the plan caches on all servers. Notice
This table caches not only SQL plan objects, but also PL objects, such as anonymous blocks, PL packages, and PL functions. Some fields are valid only for specific objects.
Related tables/views
oceanbase.__all_virtual_plan_stat
Fields
| Name | Type | Nullable | Description |
|---|---|---|---|
| tenant_id | bigint(20) | NO | The ID of the tenant. |
| svr_ip | varchar(32) | NO | The IP address of the OBServer. |
| svr_port | bigint(20) | NO | The port number of the OBServer. |
| plan_id | bigint(20) | NO | The ID of the plan. |
| sql_id | varchar(32) | NO | The SQL ID corresponding to the cached object. If it is a PL object, the value of this field is NULL. |
| type | bigint(20) | NO | For SQL plan caching, this field indicates the type of the plan. Valid values: * 1: local plan * 2: remote plan * 3: distributed plan For PL object caching, this field indicates the type of the PL object. Valid values: * 1: Procedure * 2: Function * 3: Package * 4: Anonymous block |
| is_bind_sensitive | bigint(20) | NO | Indicates whether Adaptive Cursor Sharing (ACS) needs to be enabled for the plan. |
| is_bind_aware | bigint(20) | NO | Indicates that ACS is enabled for the plan. |
| db_id | bigint(20) unsigned | NO | The ID of the database. |
| statement | varchar(4096) | NO | This field is a parameterized SQL statement for an SQL plan, a parameterized anonymous block statement for an anonymous block object, and invalid for other objects. |
| query_sql | varchar(65536) | NO | For an SQL plan, this field is the original SQL statement queried when the plan was loaded for the first time. For an anonymous block, this field is a parameterized anonymous block statement. |
| special_params | varchar(4096) | NO | The values of parameters that cannot be parameterized. |
| param_infos | varchar(65536) | NO | The parameter information. |
| sys_vars | varchar(4096) | NO | The value of the system variable that affects the plan. |
| plan_hash | bigint(20) unsigned | NO | The hash value of the SQL plan. |
| first_load_time | timestamp(6) | NO | The time when the plan was loaded for the first time. |
| schema_version | bigint(20) | NO | The version number of the schema. |
| merged_version | bigint(20) | NO | The compaction version corresponding to the current cached plan. |
| last_active_time | timestamp(6) | NO | The time of the last execution. |
| avg_exe_usec | bigint(20) | NO | The average execution time. |
| slowest_exe_time | timestamp(6) | NO | The timestamp of the slowest execution. |
| slowest_exe_usec | bigint(20) | NO | The time consumed by the slowest execution. |
| slow_count | bigint(20) | NO | The number of times that the current SQL plan was identified as a slow query. |
| hit_count | bigint(20) | NO | The number of hits. |
| plan_size | bigint(20) | NO | The size of memory occupied by cached objects. |
| executions | bigint(20) | NO | The number of executions. |
| disk_reads | bigint(20) | NO | The total number of physical reads of all executions. |
| direct_writes | bigint(20) | NO | The total number of physical writes of all executions. |
| buffer_gets | bigint(20) | NO | The total number of logical reads of all executions. |
| application_wait_time | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the application class. |
| concurrency_wait_time | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the concurrency class. |
| user_io_wait_time | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the user_io class. |
| rows_processed | bigint(20) | NO | The total number of rows in the results selected in all executions or the number of rows modified by executing the ALTER TABLE statement. |
| elapsed_time | bigint(20) unsigned | NO | The amount of time elapsed from when the request was received to when the execution of the request ended. |
| cpu_time | bigint(20) unsigned | NO | The total amount of CPU time used by all executions. |
| large_querys | bigint(20) | NO | The number of times the cached object was considered a large query. |
| delayed_large_querys | bigint(20) | NO | The number of times the cached object was considered a large query and dropped to the large query queue. |
| delayed_px_querys | bigint(20) | NO | The number of times a parallel query was dropped back into the queue for retry. |
| outline_version | bigint(20) | NO | The version number of the outline. |
| outline_id | bigint(20) | NO | The ID of the outline. The value "-1" indicates that the plan is not generated based on a bound outline. |
| outline_data | varchar(65536) | NO | The information about the outline corresponding to the plan. |
| acs_sel_info | varchar(65536) | NO | The range of selectivity for the current ACS plan. |
| table_scan | TINYINT(4) | NO | Indicates whether the query is a primary key scan. |
| evolution | tinyint(4) | NO | Indicates whether the execution plan is evolving. |
| evo_executions | bigint(20) | NO | The number of evolutions. |
| evo_cpu_time | bigint(20) unsigned | NO | The total amount of CPU time for executions during the evolution. |
| timeout_count | bigint(20) | NO | The number of timeouts. |
| ps_stmt_id | bigint(20) | NO | The ID of the PreparedStatement. |
| sessid | bigint(20) unsigned | NO | The ID of the session containing the cached object. |
| temp_tables | varchar(65536) | NO | The name of the temporary table in the SQL plan. This field is left empty if no temporary table exists. |
| is_use_jit | tinyint(4) | NO | Indicates whether just-in-time (JIT) compilation is enabled for the SQL plan. |
| object_type | varchar(65536) | NO | The type of the cached object. Valid values: * SQL_PLAN * PROCEDURE * FUNCTION * PACKAGE * ANONYMOUS |
| hints_info | varchar(65536) | NO | The hints of the SQL plan. |
| hints_all_worked | tinyint(4) | NO | Indicates whether all the hints in the SQL plan have taken effect. |
| pl_schema_id | bigint(20) unsigned | NO | This field is the schema ID of the cached object for PL objects of non-anonymous blocks, is identical to ps_stmt_id for anonymous blocks, and meaningless for SQL plans. |
| is_batched_multi_stmt | tinyint(4) | NO | Indicates whether the plan has been optimized for batch execution of multiple statements. |