---
title: PersistentQueryConfigurationLogV2
---

The [Persistent Query Controller](../../sys-admin/pq-controller/pq-controller.md) manages all [Persistent Queries](../../query-management/pq-overview.md) (PQs) in Deephaven. The controller is responsible for starting, stopping, and monitoring the health of the PQs. It also manages the configuration of the queries, including their memory allocation, scheduling, and other parameters.

Whenever a PQ is created, modified, or deleted, the controller adds a row to the `PersistentQueryConfigurationLogV2` table with its latest version. Deephaven uses this log when a query is [reverted](../../legacy/legacy-ui/classic/query-config.md#reverting-to-a-previous-version-of-a-persistent-query) to a previous version. This table replaces the deprecated `PersistentQueryConfigurationLog` table.

The history of PQ state (when they're started or stopped) is stored in the [Persistent Query State Log](./persistent-query-state-log.md) table.

## Columns

| Column Name                     | Column Type     | Description                                                                                                                                                                                                                                                                                                                             |
| ------------------------------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Date`                          | String          | The date the update occurred. This is the partitioning column.                                                                                                                                                                                                                                                                          |
| `Timestamp`                     | DateTime        | The timestamp when the update occurred.                                                                                                                                                                                                                                                                                                 |
| `SerialNumber`                  | long            | The query's serial number (a system-generated identifier unique to each PQ).                                                                                                                                                                                                                                                            |
| `VersionNumber`                 | long            | The query's version number (a number that starts at 1 for each query and is incremented each time the query is updated).                                                                                                                                                                                                                |
| `Owner`                         | String          | The owner of the PQ.                                                                                                                                                                                                                                                                                                                    |
| `Name`                          | String          | The name of the PQ.                                                                                                                                                                                                                                                                                                                     |
| `EventType`                     | long            | The query configuration event that triggered the log entry: <ul><li>`ADDED` - a PQ was added or modified</li><li>`INITIAL` - a controller logs all queries it is managing with EventType of INITIAL when it first starts</li><li>`REMOVED` - a PQ was deleted</li></ul>                                                                 |
| `Enabled`                       | boolean         | <ul><li>`true` - the query is enabled</li><li>`false` - the query is disabled (will not be started by the controller)</li></ul>                                                                                                                                                                                                         |
| `HeapSizeInGB`                  | double          | The heap size for the query in GB (the memory the query has available).                                                                                                                                                                                                                                                                 |
| `AdditionalMemoryInGB`          | double          | The amount of additional memory (in GB) allocated to beyond the JVM heap memory.                                                                                                                                                                                                                                                        |
| `DataBufferPoolToHeapSizeRatio` | double          | The data buffer to heap size ratio is the fraction of the query's heap dedicated to caching binary data from the underlying Deephaven data sources.                                                                                                                                                                                     |
| `DetailedGCLoggingEnabled`      | boolean         | If `true`, Java garbage collection details are logged for the query.                                                                                                                                                                                                                                                                    |
| `OmitDefaultGCParameters`       | boolean         | This parameter is deprecated.                                                                                                                                                                                                                                                                                                           |
| `DbServerName`                  | String          | The server on which the query will be run; this is shown as `DB_SERVER_<number>`, and these names are translated to physical or virtual servers by the controller.                                                                                                                                                                      |
| `RestartUsers`                  | String          | Specifies which group of users are allowed to restart the query: <ul><li>`Admin` - only administrators of the query can restart it</li><li>`AdminAndViewers` - administrators and viewers of the query can restart it</li><li>`ViewersWhenDown` - administrators can restart the query, and viewers only if it is not running</li></ul> |
| `ScriptCode`                    | String          | The code for the script if it is not stored in git.                                                                                                                                                                                                                                                                                     |
| `ScriptPath`                    | String          | The script path if it is stored in git.                                                                                                                                                                                                                                                                                                 |
| `ScriptLanguage`                | String          | If the PQ has a script, the language of the script; either `Groovy` or `Python`.                                                                                                                                                                                                                                                        |
| `ExtraJvmArguments`             | String[]        | Extra JVM arguments to be passed to Java when the query is started.                                                                                                                                                                                                                                                                     |
| `ExtraEnvironmentVariables`     | String[]        | Environment variables to be set in the PQ's environment before it is started.                                                                                                                                                                                                                                                           |
| `ClassPathAdditions`            | String[]        | Additional elements to be added to the class path for the JVM.                                                                                                                                                                                                                                                                          |
| `KubernetesControl`             | String          | For a Kubernetes installation, the [advanced Kubernetes options](../../query-management/ui-queries.md#show-advanced) for the PQ such as `cpu_shares` and `container_image`.                                                                                                                                                             |
| `PythonControl`                 | String          | For a Python worker, the [advanced Python options](../../query-management/ui-queries.md#show-advanced) for the PQ such as `ephemeral_venv` and `ephemeral_requirements`.                                                                                                                                                                |
| `GenericWorkerControl`          | String          | Core+ `worker_creation` JSON fields.                                                                                                                                                                                                                                                                                                    |
| `AdminGroups`                   | String[]        | Additional administrators for the query (i.e., users or groups that can edit, start, stop, or delete the query).                                                                                                                                                                                                                        |
| `ViewerGroups`                  | String[]        | Additional viewers for the query (i.e., users or groups that can view the query and its resulting tables).                                                                                                                                                                                                                              |
| `ConfigurationType`             | String          | The PQ [configuration type](../../query-management/pq-overview.md#types-of-pqs).                                                                                                                                                                                                                                                        |
| `Scheduling`                    | String[]        | Specifies the scheduling details for the query.                                                                                                                                                                                                                                                                                         |
| `Timeout`                       | long            | The [timeout](../../query-management/ui-queries.md#timeout) value in milliseconds.                                                                                                                                                                                                                                                      |
| `TypeSpecificFields`            | `java.util.Map` | Map for fields specific to configuration types.                                                                                                                                                                                                                                                                                         |
| `WorkerKind`                    | String          | The type of worker, either `DeephavenEnterprise` or `DeephavenCommunity`.                                                                                                                                                                                                                                                               |
| `JVMProfile`                    | String          | The JVM profile to be used for the query.                                                                                                                                                                                                                                                                                               |
| `LastModifiedByAuthenticated`   | String          | The authenticated user (e.g., the user who logged in via password, SAML, etc.) who last modified this query.                                                                                                                                                                                                                            |
| `LastModifiedByEffective`       | String          | The effective user (e.g., the "operate as" user if the authenticated user is using the "operate as" option) who last modified this query.                                                                                                                                                                                               |
| `LastModifiedTime`              | DateTime        | The last time this query was modified.                                                                                                                                                                                                                                                                                                  |
| `ReplicaCount`                  | int             | The number of [replicas](../../performance/pq-redundancy.md#replicas) of the PQ to run.                                                                                                                                                                                                                                                 |
| `SpareCount`                    | int             | The number of [failover spares](../../performance/pq-redundancy.md#spares).                                                                                                                                                                                                                                                             |
| `AssignmentPolicy`              | String          | The [assignment policy](../../performance/pq-redundancy.md#assignment-policies) for replica PQs.                                                                                                                                                                                                                                        |
| `AssignmentPolicyParams`        | String          | The [assignment policy parameters](../../performance/pq-redundancy.md#assignment-policies) for replica PQs.                                                                                                                                                                                                                             |

## Example

To see changes in the configuration of a specific Persistent Query (PQ), you can filter the `PersistentQueryConfigurationLogV2` table by the query's name. The following example shows how to do this in both Core+ Python and Groovy, using today's data.

```python
pqcl = (
    db.live_table("DbInternal", "PersistentQueryConfigurationLogV2")
    .where(["Date=today()", "Name=`<PQ Name>`"])
    .sort("Timestamp")
)
```

```groovy
pqcl=db.liveTable("DbInternal", "PersistentQueryConfigurationLogV2").where("Date=today()", "Name=`<PQ Name>`").sort("Timestamp")
```

## Related documentation

- [Internal tables overview](./internal-tables.md)
- [`AuditEventLog`](./audit-event-log.md)
- [`PersistentQueryStateLog`](./persistent-query-state-log.md)
- [`ProcessEventLogIndex`](./process-event-log-index.md)
- [`ProcessEventLog`](./process-event-log.md)
- [`ProcessInfo`](./process-info.md)
- [`ProcessMetrics`](./process-metrics.md)
- [`QueryOperationPerformanceLogCoreV2Index`](./query-operation-performance-log-index.md)
- [`QueryOperationPerformanceLogCoreV2`](./query-operation-performance-log.md)
- [`QueryPerformanceLogCoreV2`](./query-performance-log.md)
- [`QueryUserAssignmentLog`](./query-user-assignment-log.md)
- [`ResourceUtilization`](./resource-utilization.md)
- [`ServerStateLogIndex`](./server-state-log-index.md)
- [`ServerStateLog`](./server-state-log.md)
- [`UpdatePerformanceLogCoreV2Index`](./update-performance-log-core-index.md)
- [`UpdatePerformanceLogCoreV2`](./update-performance-log-core.md)
- [`WorkspaceDataSnapshot`](./workspace-data-snapshot.md)
- [`WorkspaceData`](./workspace-data.md)
