Purpose
v$plan_cache_plan_stat displays the status of each object that is cached by the current tenant in the plan cache on the current server.
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
gv$plan_cache_plan_stat
Fields
| Field | Type | Nullable? | Description |
|---|---|---|---|
| tenant_id | bigint(20) | NO | The ID of the tenant. |
| svr_ip | varchar(32) | NO | The IP address of the server. |
| svr_port | bigint(20) | NO | The port number of the server. |
| 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, this field is NULL. |
| type | bigint(20) | NO | For SQL plan caching, this field indicates the type of the plan. Valid values: 1: indicates a procedure.2: indicates a function.3: indicates a package.4: indicates an anonymous block. |
| is_bind_sensitive | bigint(20) | NO | Specifies whether Adaptive Cursor Sharing (ACS) needs to be enabled for the plan. |
| is_bind_aware | bigint(20) | NO | Indicates whether ACS is enabled for the plan. |
| db_id | bigint(20) unsigned | NO | The ID of the database. |
| statement | varchar(65536) | NO | If the cached object is an SQL plan, the field value is a parameterized SQL statement. If the cached object is a PL object, the field value is a parameterized anonymous block statement. This field is invalid for other types of objects. |
| query_sql | varchar(65536) | NO | If the cached object is an SQL plan, the field value is the original SQL statement queried when the plan was loaded for the first time. If the cached object is a PL object, the field value is a parameterized anonymous block statement. |
| special_params | varchar(4096) | NO | The values of parameters that cannot be parameterized. |
| param_infos | longtext | NO | The parameter information. |
| sys_vars | varchar(4096) | NO | The values of system variables that affect the cached object. |
| plan_hash | bigint(20) | 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 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 duration. |
| slowest_exe_time | timestamp(6) | NO | The timestamp of the slowest execution. |
| slowest_exe_usec | bigint(20) | NO | The time consumed for 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 the cached object. |
| 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 for all executions or the number of rows modified by executing the ALTER TABLE statement. |
| elapsed_time | bigint(20) unsigned | NO | The total time consumed by all executions, that is, the time elapsed from when the execution requests were received to when the execution of all requests was completed. |
| cpu_time | bigint(20) unsigned | NO | The total amount of CPU time consumed 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 placed in the large query queue. |
| delayed_px_querys | bigint(20) | NO | The number of times the parallel query was placed in the queue for retries. |
| outline_version | bigint(20) | NO | The version 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-enabled plan. |
| table_scan | tinyint(4) | NO | Specifies 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 prepared statement corresponding to the request. -1: indicates that the prepared statement (PS) protocol is not used in the SQL statement.-1: indicates that the PS protocol is used in the SQL statement, and indicates the unique identifier returned by the PS protocol for the statement. |
| 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 contained 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: |
| 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, the ID of the PreparedStatement 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. |