Compute a stable query identifier (PG14+).
At a glance
| Property | Value |
|---|---|
| Parameter | compute_query_id |
| Category | Statistics |
| Default | auto |
| Value type | boolean / enum / numeric |
| Change scope | Superuser / reload |
What it does
Controls computation of a query ID used by pg_stat_activity, logging, and pg_stat_statements. auto enables it when an extension needs it.
How to apply a change
Can be changed at runtime by a superuser for the current session, or globally via reload.
Inspect the current value and source with SHOW compute_query_id; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'compute_query_id';.
Tuning guidance
Leave auto; set on to correlate query IDs across logs and pg_stat_statements even without the extension loaded.