Critical Configuration

Statistics Tracking Disabled

Statistics tracking (track_counts) is disabled, which breaks autovacuum and prevents collecting table and index statistics.

What is this issue?

The track_counts setting controls whether PostgreSQL collects statistics
about table and index activity. This data is used by:

- Autovacuum: To decide when tables need vacuuming
- pg_stat_user_tables: Row counts, dead tuples, scan counts
- pg_stat_user_indexes: Index usage statistics
- Query planner: For cost estimation

With track_counts disabled:
- Autovacuum cannot make informed decisions
- You can't see table/index statistics
- PG Pilot cannot provide accurate metrics

Why it matters

Broken Autovacuum

Autovacuum can't determine which tables need maintenance

No Statistics

pg_stat views show zeros or nulls

Blind Monitoring

Can't see table activity or dead tuple counts

Poor Planning

Query planner lacks runtime statistics

How PG Pilot detects it

```sql
SELECT name, setting
FROM pg_settings
WHERE name = 'track_counts';
```

How to fix it

1

Enable track_counts

This requires a server restart:

ALTER SYSTEM SET track_counts = on;

Then restart PostgreSQL.

2

Verify statistics collection

After restart, check that statistics are being collected:

SELECT * FROM pg_stat_user_tables LIMIT 5;

Values should be non-zero for active tables.

3

Run ANALYZE

Rebuild table statistics:

ANALYZE;

Prevention

  • Never disable track_counts in production
  • Use configuration management to enforce this setting
  • Monitor with PG Pilot for configuration drift

Related Issues

Related Features

PostgreSQL Documentation