

# Process list table: router\_processlist

The process list of a database cluster group for Aurora has one row for each session at the routing endpoint. It's the table `dbclustergroup_sys.router_processlist`.

## Purpose
<a name="databaseclustergroups-sysviews-router-processlist-purpose"></a>

Use the process list to see who is connected through the routing endpoint, what each session runs, and which member cluster each session reaches. It shows the sessions of every routing-layer instance in the group that answers. An instance that doesn't answer adds no rows, and the result carries a warning that some rows are missing. Run `SHOW WARNINGS` after the query to check. The process list is read-only.

The process list shows routing endpoint sessions only. Direct connections to a member cluster's endpoint, such as maintenance scripts, batch jobs, and schema tools, appear only on that member cluster. To see the member cluster side of a session, read the session list on the member cluster. To follow one session to its member cluster sessions, see [Tracing a session or statement across the group](databaseclustergroups-trace-session.md).

Any router user sees their own sessions, with the user, host, and statement text of each. To see the sessions of other router users, you need `dbclustergroup_process_admin`.

## Columns and example queries
<a name="databaseclustergroups-sysviews-router-processlist-columns"></a>

The table is `dbclustergroup_sys.router_processlist`. At the routing endpoint, `SHOW PROCESSLIST` and `SHOW FULL PROCESSLIST` don't read this table and return error 1235, so query this table instead. In a session pinned with `router_cluster_pin`, `SHOW PROCESSLIST` returns the process list of the pinned member cluster, not the routing layer's sessions.

**Columns**

The table has the following columns.


| Column | Type | Description | 
| --- | --- | --- | 
| id | BIGINT | The global connection ID of the session: a 32-bit positive integer that is unique across the group. It stays with the session for its whole life, and it's the ID that KILL takes. | 
| user | VARCHAR | The router user. | 
| host | VARCHAR | The client host, without a port. | 
| db | VARCHAR | The default database of the session, as in SHOW PROCESSLIST. | 
| command | VARCHAR | Query or Sleep. | 
| time | BIGINT | The time in seconds that the session has been in its current state, as in SHOW PROCESSLIST. The timer restarts when the statement moves from ROUTING to EXECUTING. | 
| state | VARCHAR | IDLE, ROUTING while the routing layer parses and routes the statement, or EXECUTING after it sends the statement to a member cluster. | 
| info | VARCHAR | The statement that the session runs, up to 1,024 bytes, with each password replaced by <secret>. Other literal values are shown as sent. NULL when the session is idle, or when the routing layer can't check a pinned session's text for credentials. | 
| member\_cluster\_alias | VARCHAR | The member cluster that the session is bound to. | 
| pin\_status | VARCHAR | Pinned or Unpinned. | 

**Where to query it**

Query the table at the routing endpoint, in an unpinned session. In a pinned session, the member cluster's own process list answers instead. Filter the table with a `WHERE` clause. For the shapes that every system table accepts, see [Filters the system tables accept](databaseclustergroups-system-views.md#databaseclustergroups-sysviews-filters).

In addition to `column = 'value'`, `router_processlist` accepts the comparison operators `!=`, `<>`, `<`, `<=`, `>`, and `>=`, and conditions combined with `AND`, for example `WHERE command = 'Query' AND time >= 60` for statements that have run for a minute or more. Each condition must have a column on the left and a literal value on the right. Unlike the other system tables, `router_processlist` doesn't accept a tuple equality such as `(user, command) = ('app', 'Query')`. The routing layer returns error 1235 for `OR`, `IS NULL`, `LIKE`, `IN`, `BETWEEN`, `NOT`, functions such as `CONNECTION_ID()`, and `ORDER BY`. Like the other system tables, `router_processlist` accepts `LIMIT n`, `LIMIT n OFFSET m`, and `LIMIT m, n`. Its rows have no fixed order, so `OFFSET` doesn't page through it reliably.

**Ending a session**

To end a session, run `KILL CONNECTION` with its `id` at the routing endpoint. It ends the session and its member cluster connections. To cancel the running statement and keep the session open, run `KILL QUERY`. You can end your own sessions. To end the sessions of other router users, you need `dbclustergroup_connection_admin`.

**Example queries**

The following query lists every session at the routing endpoint that you can see.

```sql
SELECT * FROM dbclustergroup_sys.router_processlist;
```

The following query reads one session, by its literal ID.

```sql
SELECT * FROM dbclustergroup_sys.router_processlist WHERE id = 4711;
```

The following query lists the open sessions of one router user.

```sql
SELECT id, user, host, db, command, time
  FROM dbclustergroup_sys.router_processlist
 WHERE user = 'app_user';
```

## Related topics
<a name="databaseclustergroups-sysviews-router-processlist-related"></a>

For more information, see the following topics:
+ [Tracing a session or statement across the group](databaseclustergroups-trace-session.md)
+ [router\_cluster\_pin](databaseclustergroups-router-session-variables.md#databaseclustergroups-sysviews-router-cluster-pin), the session variable that sets a session pin
+ [SHOW, KILL, and catalog reads](databaseclustergroups-router-answers.md#databaseclustergroups-sysviews-catalog), which includes `SHOW` and `KILL` at the routing endpoint
+ [Names, IDs, and consistency](databaseclustergroups-system-views.md#databaseclustergroups-sysviews-ids)