# SHOW PROFILE

Returns profiling information for queries and pipelines run in `PROFILE` mode. Use `SHOW PROFILE` after running the `PROFILE` command (or when auto profiling is enabled) to inspect resource‑usage metrics for a specific query plan, query execution, or pipeline. By default, `SHOW PROFILE` displays the execution profile as a tree with resource-usage metrics appended to each operator.

## Syntax

```sql
SHOW PROFILE [JSON | UI]
  [PLAN <plan_id>]
  [PROCESS <process_id>]
  [PIPELINE <pipeline_name>]
  [ON NODE <node_id>]
  [INTO OUTFILE '<file_name>'];

```

## Arguments

## JSON

Returns profile information in `JSON` format for programmatic processing or external visualization. `SHOW PROFILE JSON` includes detailed operator statistics and compilation-time statistics such as `compile_time_stats`. It also includes partition-level details for skew-related metrics, even when there is no skew. For the complete `JSON` structure and examples, refer to [Profile JSON Fields](https://docs.singlestore.com/db/v9.1/reference/sql-reference/data-manipulation-language-dml/profile/#section-idm4544909699326433723498651607.md).

## UI

Returns a URL that opens a visual representation of the profile in [SingleStore Visual Explain](https://docs.singlestore.com/db/v9.1/query-data/query-tuning/singlestore-visual-explain.md).

## PLAN `plan_id`

Returns profile information for a compiled query plan that has been executed in `PROFILE` mode and exists in the plancache. For details about plan IDs, refer to `SHOW PLAN`.

## PROCESS `process_id`

Returns profile information for a specific query execution identified by its process ID. Returns the active profile if the query is currently running in `PROFILE` mode, otherwise returns the most recent completed profile for that process. Refer to `SHOW PROCESSLIST` or `CONNECTION_ID()` to obtain process IDs.

**Note**: To profile a hung or long-running query, run the `PROFILE` statement in one connection and `SHOW PROFILE PROCESS` in another connection while the query is running. This allows you to monitor the progress and resource usage of queries with long execution times.

## PIPELINE `pipeline_name`

Returns profile information for a pipeline that has been run in `PROFILE` mode.

## ON NODE `node_id`

Runs the command on the specified node. Use this option only in combination with `PLAN`, `PROCESS`, and `PIPELINE`.

## INTO OUTFILE `'file_name'`

Writes the profile output to a file. `INTO OUTFILE` cannot be used if the statement is forwarded to a different node.

## Remarks

* Refer to the `PROFILE` command for detailed information about enabling profiling, auto profiling configuration, metric definitions, output formats, and examples.
* `SHOW PROFILE` displays existing profiling data. It does not execute or re‑profile a query or pipeline by itself. Running `SHOW PROFILE` for a plan, process, or pipeline that has never been profiled results in an error indicating that profile statistics do not exist.
* `SHOW PROFILE [JSON | UI]` without `PLAN`, `PROCESS`, or `PIPELINE` returns the profile for the most recent statement that was run in `PROFILE` mode on that connection.

## Examples

* View the profile for the most recent query execution:
  ```sql
  PROFILE SELECT * FROM employees WHERE department = 'Engineering';
  SHOW PROFILE;

  +-------------------------------------+------------------------------------------+
  |PROFILE                                                                         |
  |Top limit:[@@SESSION.`sql_select_limit`] actual_rows: 4 exec_time: 0ms          |
  |Gather partitions:all alias:remote_0 parallelism_level:segment exec_time: 0ms   |  
  |start_time: 00:00:00.000 end_time: 00:00:00.086 network_traffic: 0.101000 KB    | 
  |network_time: 0ms actual_rows: 3                                                |
  |Project [employees.id, employees.name, employees.department] actual_rows: 3     |  
  |exec_time: 0ms start_time: 00:00:00.086 network_traffic: 0.101000 KB            | 
  |network_time: 0ms                                                               |
  |Top limit:[?] actual_rows: 3 exec_time: 0ms                                     |
  |ColumnStoreFilter [employees.department = ?] actual_rows: 3 exec_time: 1ms      | 
  |start_time: 00:00:00.086 total_rows_in: 3 average_filters_per_row: 1.000000     |  
  |average_index_filters_per_row: 0.000000 average_bloom_filters_per_row: 0.000000 |
  |ColumnStoreScan profiling_demo.employees, SORT KEY __UNORDERED ()               |  
  |table_type:sharded_columnstore actual_rows: 3 exec_time: 64ms start_time:       | 
  |00:00:00.021 memory_usage: 393.216003 KB number_of_blocks_tested_for_block_elim:| 
  |0 number_of_blocks_eliminated_for_block_elim: 0 segments_scanned: 2             | 
  |segments_skipped: 2 segments_fully_contained: 0 segments_in_blob_cache: 0       |
  |Compile Total Time: 25ms                                                        |
  +-----------------------------------+--------------------------------------------+

  ```
  **Note**: To get more accurate resource usage metrics, run the `PROFILE` statement twice followed by `SHOW PROFILE`. The first execution includes compilation time, while the second execution provides more accurate runtime statistics.
* View profile information in `JSON` format for a specific process:
  ```sql
  SHOW PROFILE JSON PROCESS 4534;
  ```

* View profile information for a specific plan:
  ```sql
  SHOW PROFILE PLAN 98765;
  ```
* View profile information in `JSON` format for a specific plan:
  ```sql
  SHOW PROFILE JSON PLAN 4;
  ```
* View profile information for a pipeline:
  ```sql
  SHOW PROFILE JSON PIPELINE my_data_pipeline;
  ```

***

Modified at: May 11, 2026

Source: [/db/v9.1/reference/sql-reference/show-commands/show-profile/](https://docs.singlestore.com/db/v9.1/reference/sql-reference/show-commands/show-profile/)

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