Important
The SingleStore 9.1 release candidate (RC) gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 9.1.
SHOW PLANCACHE
On this page
Shows all query statements that SingleStore has compiled and executed, as well as cumulative query execution statistics associated with each plan.
Syntax
SHOW PLANCACHERemarks
-
SHOW PLANCACHEis a SingleStore extension. -
All counters shown by
SHOW PLANCACHEare cleared when SingleStore is restarted. -
This command can be run on any SingleStore node (see Cluster Management Commands).
-
See the Permission Matrix for the required permission.
Output
|
Column |
Description |
|---|---|
|
|
Context database selected with |
|
|
Query text with all numeric and string parameters replaced by tags (depending on parameter and/or query type). |
|
|
ID of the plan. |
|
|
Indicates whether the plan was compiled with profiling enabled.
|
|
|
The profiling code generation mode for the plan. Possible values:
|
|
|
The current Feedback Reoptimization (FR) state of the plan. Possible values:
|
|
|
Specifies the Feedback Reoptimization (FR) iteration at which this plan was compiled.
|
|
|
Plan type, interpreted or compiled. Potential values: |
|
|
The source of the query plan. |
|
|
Number of successful executions of the query. |
|
|
Number of unsuccessful executions of the query (i. |
|
|
Cumulative number of rows returned by a |
|
|
The cumulative time, in milliseconds, spent executing a given query (from the time the query arrived at the server to the time the result was sent to the client). |
|
|
Average plan execution time in milliseconds. |
|
|
NULL for |
|
|
NULL for |
|
|
NULL for |
|
|
Cumulative number of rows at the cluster level streamed from leaves and processed by a given |
|
|
Cumulative time, in milliseconds, at the cluster level spent waiting for results from leaves. |
|
|
The amount of time, in milliseconds, a given query spent queued by Workload Management. |
|
|
The amount of time, in milliseconds, a given query spent queued by Resource Governance. |
|
|
The path to the plan files on disk. |
|
|
Query queued time. |
|
|
The timestamp at which a query was first created or loaded from disk. |
|
|
The timestamp at which a given query was last executed. |
|
|
The average amount of memory used to execute this query. |
|
|
Any warnings associated with the plan. |
|
|
Information about the query plan used by the optimizer, in JSON format. |
|
|
The amount of CPU time, in milliseconds, spent executing the query. |
|
|
This is the maximum memory use (in bytes) of each run, averaged across all runs of the same query plan. |
|
|
The average amount of data, in bytes, spilled to disk during query execution. |
|
|
The average number (in bytes) that could not be found in the blob cache and had to be downloaded from the unlimited storage |
|
|
The time (milliseconds) that were spent on waiting for blob cache data. |
The OptimizerNotes column may contain the following information:
-
table_: Table row counts and other statistics.row_ counts -
prospective_: Queries in the plancache that could have made use of histograms.histograms If there are no queries that could have used histograms, this key will not display. -
is_: Value is true for a single partition; otherwise, false.single_ partition -
num_: Number of materialized CTEs in the plan.materialized_ ctes -
connections_: Number of connections per leaf.per_ leaf -
thread_: Number of threads per leaf.per_ leaf -
average_,leaf_ memory average_: Average memory usage by leaf and average query runtime statistics collected by Workload Management.runtime -
num_,broadcasts num_: Number of broadcasts or reshuffles in the plan.reshuffles Note
SingleStore returns
-1fornum_andreshuffles num_when the workload manager is not managing (or tracking) the query based on the number of connections (or threads).broadcasts For example:
--- "LogBufferTime": 0, "LogFlushTime": 0, "OptimizerNotes": "{\"num_broadcasts\": -1, \"num_reshuffles\": -1, \"is_single_partition\": false, \"average_leaf_memory\": 0, \"average_runtime\": 0}", "PlanId": 57080, "PlanType": "LLVM", "PlanWarnings": "", ---
Example
SHOW PLANCACHE;
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+-----------+--------------------+-----------------+--------------+----------+------------+---------+-----------+----------+---------------+-----------------+---------------+--------------+-------------+--------------+-----------------+------------------------------+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+---------------------+---------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+------------------------+---------------------------+-------------------------+
| Database | QueryText | PlanId | IsProfile | ProfileCodeGenMode | ReoptimizeState | ReoptimizeID | PlanType | PlanSource | Commits | Rollbacks | RowCount | ExecutionTime | AverageExecTime | LogBufferTime | LogFlushTime | RowLockTime | StreamedRows | LeafNetworkTime | WorkloadManagementQueuedTime | ResourcePoolQueuedTime | MplPath | QueuedTime | FirstLoadTime | LastExecuted | AverageMemoryUse | PlanWarnings | OptimizerNotes | CpuTime | AverageMaxMemoryUse | AverageDiskSpillingUse | AverageBlobCacheMissBytes | BlobCacheWaitTimeMillis |
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+-----------+--------------------+-----------------+--------------+----------+------------+---------+-----------+----------+---------------+-----------------+---------------+--------------+-------------+--------------+-----------------+------------------------------+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+---------------------+---------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+------------------------+---------------------------+-------------------------+
| information_schema | SELECT @@memsql_id | 0 | 0 | OFF | NONE | 0 | LLVM | LOCAL | 126 | 0 | 126 | 60 | 0 | NULL | NULL | NULL | 0 | 0 | 0 | 0 | /data/master/plancache/9b7/Select_dual_9b762a0c0e1e08e9c0230ff4340794d079208441ed295711cf51a45e5c4714a0_41f48257ff918236 | 0 | 2026-05-14 20:12:25 | 2026-05-14 20:14:27 | 454 | | {"join_memory_costs_estimates":{"rows_in_memory": 0, "bytes_in_memory": 0, "total_tables_saved_in_memory": 0}, "num_thread_per_leaf": 0, "num_connections_per_leaf": 0, "num_broadcasts": 0, "num_reshuffles": 0, "num_materialized_ctes": 0, "is_compiled_run": true, "reoptimize_misestimation_count": -1, "is_single_partition": true, "average_leaf_memory": 0, "average_runtime": 0, "used_pinned_plan": 0, "pinned_plan": 0} | 26 | 1040 | 0 | 0 | 0 |
| information_schema | SELECT @@memsql_version | 2 | 0 | OFF | NONE | 0 | LLVM | LOCAL | 20 | 0 | 20 | 2 | 0 | NULL | NULL | NULL | 0 | 0 | 0 | 0 | /data/master/plancache/124/Select_dual_124cebcae224cf49eb164df1625f616108084ac54cfea17dd768a5e510b5652f_40393a6f6276d15b | 0 | 2026-05-14 20:12:25 | 2026-05-14 20:14:26 | 5714 | | {"join_memory_costs_estimates":{"rows_in_memory": 0, "bytes_in_memory": 0, "total_tables_saved_in_memory": 0}, "num_thread_per_leaf": 0, "num_connections_per_leaf": 0, "num_broadcasts": 0, "num_reshuffles": 0, "num_materialized_ctes": 0, "is_compiled_run": true, "reoptimize_misestimation_count": -1, "is_single_partition": true, "average_leaf_memory": 0, "average_runtime": 0, "used_pinned_plan": 0, "pinned_plan": 0} | 1 | 6553 | 0 | 0 | 0 |
| | select @@version_comment limit 1 | 9 | 1 | PARTIAL | NONE | 0 | LLVM | LOCAL | 1 | 0 | 1 | 14 | 14 | NULL | NULL | NULL | 0 | 0 | 0 | 0 | /data/master/plancache/6d9/Select_profile_partial_dual_6d91d511c9276f5039cd124f4ba601c3a5d8acbfd9385230c45dd6b20fd3ddce_6205564fa208549f | 0 | 2026-05-14 20:14:16 | 2026-05-14 20:14:16 | 253007 | | {"join_memory_costs_estimates":{"rows_in_memory": 0, "bytes_in_memory": 0, "total_tables_saved_in_memory": 0}, "num_thread_per_leaf": 0, "num_connections_per_leaf": 0, "num_broadcasts": 0, "num_reshuffles": 0, "num_materialized_ctes": 0, "is_compiled_run": false, "reoptimize_misestimation_count": -1, "is_single_partition": true, "average_leaf_memory": 0, "average_runtime": 0, "used_pinned_plan": 0, "pinned_plan": 0} | 11 | 393216 | 0 | 0 | 0 |
+--------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------+-----------+--------------------+-----------------+--------------+----------+------------+---------+-----------+----------+---------------+-----------------+---------------+--------------+-------------+--------------+-----------------+------------------------------+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+---------------------+---------------------+------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+------------------------+---------------------------+-------------------------+Last modified: