Skip to content

Document datapoint chunk interval and compression metrics - #214

Merged
richturner merged 3 commits into
mainfrom
docs/datapoint-chunk-interval
Nov 30, 2026
Merged

richturner merged 3 commits into
mainfrom
docs/datapoint-chunk-interval

Conversation

@richturner

@richturner richturner commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Documents the changes in openremote/core#3620. Merge this after that PR.

Changes

Developer guide: System administration, Database

  • New "Chunk interval" section
    • How the asset_datapoint chunks work: the chunk being written stays uncompressed, and each chunk is compressed 1 day after it ends.
    • Why a large uncompressed chunk makes recent-data queries slow.
    • The new OR_DATA_POINTS_CHUNK_INTERVAL_DAYS setting, applied at startup to new chunks only.
    • Sizing guidelines: the chunk being written should fit in shared_buffers; every chunk adds planning and lock cost; small chunks compress less well.
    • A note about the one-off compression of the previous chunk after upgrading.
  • Datapoint retention: the purge now runs daily, and the chunk interval is configurable.
  • Memory sizing guidelines: step 1 and the 25% rule now use the projected size of the chunk being written instead of the largest uncompressed chunk. To reduce the chunk interval, set OR_DATA_POINTS_CHUNK_INTERVAL_DAYS rather than calling set_chunk_time_interval() by hand.
  • Monitoring metrics table: added pg_datapoint_chunk_memory_ratio, pg_datapoint_chunks_needing_compression, pg_datapoint_uncompressed_chunk_count, pg_datapoint_chunk_count, the uncompressed chunk block hit/read counters, pg_datapoint_compressed_rowstore_size and the WAL full page image counters, and updated the note on pg_datapoint_largest_uncompressed_chunk.

User guide: Metrics

  • Added pg_datapoint_chunk_interval_days, pg_datapoint_write_rate_per_day, pg_datapoint_projected_chunk_size and pg_datapoint_chunk_memory_ratio.
  • Added pg_datapoint_compressed_rowstore_size, pg_datapoint_uncompressed_blks_hit_total, pg_wal_records_total and pg_wal_fpi_total.
  • Removed pg_datapoint_uncompressed_cache_hit_ratio, replaced by the pg_datapoint_uncompressed_blks_hit_total and pg_datapoint_uncompressed_blks_read_total counters (hit ratio = rate(hit) / (rate(hit) + rate(read))).
  • Updated the descriptions of pg_datapoint_chunks_needing_compression, pg_connections_used, pg_connections_free, pg_last_autovacuum_hours, pg_last_autoanalyze_hours, pg_datapoint_chunk_end_weeks, pg_datapoint_uncompressed_blks_read_total and pg_background_errors.

Versioned docs are unchanged because they describe released versions.

Document OR_DATA_POINTS_CHUNK_INTERVAL_DAYS with chunk sizing guidelines,
the 1 day columnstore compress_after, the daily purge and the new chunk
sizing query-exporter metrics (openremote/core#3620).
@richturner richturner self-assigned this Nov 25, 2026
@richturner
richturner requested a review from a team November 25, 2026 16:59
Add pg_datapoint_compressed_rowstore_size, pg_datapoint_uncompressed_blks_hit_total,
pg_wal_records_total and pg_wal_fpi_total, remove the replaced
pg_datapoint_uncompressed_cache_hit_ratio and update descriptions that changed.
@richturner
richturner merged commit 86fab12 into main Nov 30, 2026
1 check passed
@richturner
richturner deleted the docs/datapoint-chunk-interval branch November 30, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant