# MV\_PLANCACHE

This view shows plancache information for all nodes in the cluster.

It shows all plans that are currently in SingleStore’s in-memory plancache for all nodes - plans are removed from this view, and statistics and counters are reset to zero, when the plan expires (after being unused for the setting of the engine variable `plan_expiration_minutes`), when the node restarts, or when the plan must be recompiled or reloaded (e.g. when the table is altered). It does not show the plans held on disk.

| Column Name                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NODE_ID`                         | The ID of the node.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `DATABASE_NAME`                   | Context database selected with`USE <database_name>`when query was compiled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `QUERY_TEXT`                      | Query text with all numeric and string parameters replaced by tags (depending on parameter and/or query type).`@`is used for integers and`^`for string parameters.`?`is always used for INSERT queries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `PLAN_ID`                         | The unique`ID`of the query plan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `IS_PROFILE`                      | Indicates whether the plan was compiled with profiling enabled.<ul> <li><code>1</code>: Plan was compiled with a profiling codegen mode.</li> <li><code>0</code>: Profile statistics are not collected.</li> </ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `PROFILE_CODEGEN_MODE`            | Profile codegen mode used when compiling the plan. It can have the following values:<ul> <li><code>OFF</code>: No profiling.</li> <li><code>FULL</code>: Full profiling for <code>PROFILE</code> queries and auto-profile <code>LITE</code>/<code>FULL</code> mode.</li> <li><code>PARTIAL</code>: Lightweight profiling for <code>SMART</code> auto-profile mode (primarily for row-count statistics).</li> </ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `REOPTIMIZE_STATE`                | Specifies Feedback Reoptimization (FR) state for this plan. Typical values include:<ul> <li><code>NONE</code>: No FR activity. This is the initial state of the plan.</li> <li><code>MANUAL MARK TO BE REOPTIMIZED</code>: Plan has been manually marked for FR (via <code>REOPTIMIZE MARK</code>) .</li> <li><code>AUTO MARK TO BE REOPTIMIZED</code>: Plan has been automatically marked (by SingleStore) for FR.</li> <li><code>BEING REOPTIMIZED</code>: An FR run is currently in progress for this plan.</li> <li><code>REOPTIMIZE FINISHED</code>: FR completed and committed an optimized plan. This plan can be marked and FR'd again at a higher level.</li> <li><code>REOPTIMIZE CONVERGED</code>: FR did not find a better plan; further FR attempts are suppressed until conditions change.</li> <li><code>COMPILED</code>: An FR plan has been generated and is pending evaluation. The plan has not yet been executed.</li> <li><code>REOPTIMIZE BEFORE COMMIT</code>: This plan is an FR-derived plan that has been reoptimized but the result has not yet been committed.</li> <li><code>OUT OF DATE REOPTIMIZED</code>: This is an FR-derived plan from an earlier FR iteration; a newer FR iteration is already committed, making this plan stale.</li> <li><code>UNKNOWN</code>: This is an FR-derived plan whose original plan can no longer be found in the plancache (likely already evicted).</li> </ul> |
| `REOPTIMIZE_ID`                   | Specifies the Feedback Reoptimization (FR) iteration at which this plan was compiled. It can have the following values:<ul> <li><code>0</code>: This plan was not generated by FR.</li> <li><code>> 0</code>: If the value is greater than <code>0</code>, this plan was generated by FR at this iteration (value of <code>REOPTIMIZE_ID</code>). This value correlates with FR details in <code>OPTIMIZER_NOTES</code> for the same <code>PLAN_ID</code>.</li> </ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `PLAN_TYPE`                       | The type of query plan: interpreted or compiled.Potential values:`MBC`,`LLVM`,`COMPILE_LITE`, or`FAILURE`. Refer to[Code Generation](https://docs.singlestore.com/db/v9.1/query-data/advanced-query-topics/code-generation.md)for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `PLAN_SOURCE`                     | The source of the query plan. For example,`LOCAL`(local compilation) or`DPC`(Distributed Plan Cache).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `COMMITS`                         | The number of successful executions of a given query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `ROLLBACKS`                       | Number of unsuccessful executions of a given query (i.e. cases where query was aborted or encountered runtime errors).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `ROWCOUNT`                        | The cumulative number of rows returned by a`SELECT`query or the cumulative number of rows inserted, updated, or deleted for an`INSERT`,`UPDATE`, or`DELETE`query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `EXECUTION_TIME`                  | The cumulative time, in milliseconds, spent executing a given query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `AVERAGE_EXEC_TIME`               | The average execution time (in milliseconds) of a given query plan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `LOGBUFFER_TIME`                  | `NULL`for`SELECT`queries, otherwise the cumulative time (in milliseconds) spent waiting to reserve space in the transaction buffer for this query. A larger transaction buffer and faster disk can help reduce it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `LOGFLUSH_TIME`                   | `NULL`for`SELECT`queries, otherwise the cumulative time (in milliseconds) spent waiting until changes made by this query are flushed to disk. A faster disk can help reduce it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `ROWLOCK_TIME`                    | `NULL`for`SELECT`queries, otherwise the cumulative time (in milliseconds) spent waiting to acquire exclusive row locks.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `STREAMED_ROWS`                   | Cumulative number of rows at theclusterlevel streamed from leaves and processed by a given`SELECT`query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `LEAFNETWORK_TIME`                | Cumulative time, in milliseconds, at theclusterlevel spent waiting for results from leaves. This includes the time spent executing queries on the leaves.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `WORKLOAD_MANAGEMENT_QUEUED_TIME` | The amount of time, in milliseconds, a given query spent queued by Workload Management.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `RESOURCE_POOL_QUEUED_TIME`       | The amount of time, in milliseconds, a given query spent queued by Resource Governance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `MPL_PATH`                        | The path to the plan files on disk.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `QUEUED_TIME`                     | The total amount of time, in milliseconds, a given query spends queued.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `FIRST_LOAD_TIME`                 | The timestamp at which a given query was first created or loaded from disk.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `LAST_EXECUTED`                   | The timestamp at which a given query was last executed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `AVERAGE_MEMORY_USE`              | The average amount of memory used (in bytes) to execute this query, over time. Any temporary memory allocation needed to execute a query (including those for hash tables, sorts, result tables, etc.) is tracked here.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `PLAN_WARNINGS`                   | Any warnings associated with a given query plan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `PLAN_INFO`                       | Additional information about the query plan, in JSON format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `OPTIMIZER_NOTES`                 | Information about the query plan used by the optimizer, in JSON format.This value is only populated on aggregator nodes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `CPU_TIME`                        | The amount of CPU time, in milliseconds, spent executing the query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `AVERAGE_MAX_MEMORY_USE`          | This is the maximum memory use (in bytes) of all of the operators used in each run, averaged across all runs of the same query plan, over time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `AVERAGE_DISK_SPILLING_USE`       | The average amount of data (in bytes) spilt to disk during query execution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `AVERAGE_BLOB_CACHE_MISS_BYTES`   | The average number (in bytes) that could not be found in the blob cache and had to be downloaded from the unlimited storage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `BLOB_CACHE_WAIT_TIME_MS`         | The time (milliseconds) that were spent on waiting for blob cache data. This is a sum of waiting time from all query execution threads, not to be compared with end-to-end running time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `ACTIVITY_NAME`                   | The`ID`of the related activity.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `PLAN_VARIABLES`                  | The values of all engine variables that affect a given query plan.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

Use `REOPTIMIZE_STATE`, `REOPTIMIZE_ID`, and `OPTIMIZER_NOTES` together to understand how Feedback Reoptimization has interacted with a given plan. `MV_PLANCACHE` exposes both the original plan and FR-derived plans (if any) as separate rows.

***

Modified at: May 15, 2026

Source: [/db/v9.1/reference/information-schema-reference/query-performance-workload-management-and-statistics/mv-plancache/](https://docs.singlestore.com/db/v9.1/reference/information-schema-reference/query-performance-workload-management-and-statistics/mv-plancache/)

(An index of the documentation is available at /llms.txt)
