Skip to content

track_activities

track_activities — Collects information about executing commands. Observed in PG9.0–19 Beta 3; its last measured boot default is on in PG19 Beta 3, with superuser context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Collects information about executing commands.”

Identity

Type , Valuebool
Upstream pg_settings type
Context , Valuesuperuser
Settable at runtime by a superuser
Unit , Value
Raw unit
Range , Value
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueStatistics / Cumulative Query and Index Statistics
Upstream classification
Latest boot value , Valueon
on

Lifecycle

Fact Value
First observed PG9.0 (research boundary)
Present in PG9.0–19 Beta 3
Removed in No
Introduction commit Not asserted: predates the PG9.0 research boundary
Commit date
Discussion

Default history

Measured PG9.0–19 Beta 3 boot defaults
Versions Raw boot_val Unit Human value
PG9.0–19 Beta 3 on on

How it works

track_activities records each session’s current command, query identifier, and timing metadata for pg_stat_activity. Access remains privilege-filtered even when collection is enabled.

Turning it off removes essential live observability but does not terminate or speed up the command itself. The text stored per session is bounded by track_activity_query_size.

The switch can be changed by authorized users, so monitoring should detect sessions reporting disabled activity. It is separate from cumulative counters controlled by track_counts. Its superuser context permits an authorized session change without a server restart.

Tuning advice

Tip

Advice. These are workload-specific starting points and must be validated with measurements.

Workload Guidance
OLTP Keep on in production so pg_stat_activity can show the current command, query ID, and timing needed for incident response. Restrict view privileges and size track_activity_query_size separately rather than disabling activity collection to hide text.
OLAP Keep on for long analytical sessions; live phase and wait context is especially valuable during resource contention. If overhead is suspected, measure it explicitly before accepting the observability loss from off.
Small nodes Keep on. The setting is a boolean collection gate, not a buffer size; reduce query-text memory with track_activity_query_size only after preserving enough text for diagnosis.

Pigsty

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

Template Effective value Versus upstream boot Source expression
OLTP Unmodified
OLAP Unmodified
CRIT Unmodified
TINY Unmodified
Caution

Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG9.0–19 Beta 3 unmodified; OLAP: PG9.0–19 Beta 3 unmodified; CRIT: PG9.0–19 Beta 3 unmodified; TINY: PG9.0–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

Common pitfalls

  • Turning it off and losing the current-command evidence needed to diagnose blocking or runaway sessions.
  • Confusing live activity collection with cumulative counters controlled by track_counts.
  • Assuming on makes every session’s query text visible to every role; visibility remains privilege filtered.
  • Ignoring that an authorized session can disable its own activity reporting in the permitted context.

track_activity_query_size · track_counts · compute_query_id · log_line_prefix · log_min_duration_statement

References