Conversation
|
Claude finished @wezell's task in 3m 6s —— View job Code Review
3 issues worth flagging: 1. Missing PostgreSQL guard (regression) The immediately preceding task 2. UNLOGGED task has no idempotency check
3. Test plan is self-contradictory
Everything else looks clean: table/column names sourced from |
…up tasks Task260403SetPermissionReferenceUnlogged: - Converts permission_reference to UNLOGGED via ALTER TABLE SET UNLOGGED - Table is a regenerable permission cache; crash-safety is not required - Eliminates WAL write cost on every permission rebuild INSERT/DELETE - forceRun() checks pg_class.relpersistence to skip if already unlogged Task260403SetLz4CompressionOnTextColumns: - Sets LZ4 compression on all text/bytea/jsonb/json columns in public schema - Queries pg_attribute dynamically — no hardcoded column list, covers plugins - Skips columns already using LZ4 (attcompression='l') for idempotency - Continues on per-column failure so one bad column does not block all others - Gracefully skips on PostgreSQL < 14 (attcompression column absent) - LZ4 decompresses 3-5x faster than pglz; affects future writes only postgres.sql: - permission_reference CREATE TABLE now uses UNLOGGED - LZ4 SET COMPRESSION block added for all eligible columns (fresh installs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds COMPRESSION lz4 directly to all text, bytea, jsonb, and json column definitions (102 columns across all tables) rather than using ALTER TABLE statements. Applies to fresh installs; upgrades handled by the startup task. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5b1b567 to
f6a05d5
Compare
…es guard Both tasks have no side effects and run idempotent DDL, so forceRun() returns true unconditionally. Postgres-only guard removed since dotCMS runs on postgres. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added relkind = 'r' filter to restrict pg_attribute scan to regular tables only. Indexes also have entries in pg_attribute but do not support SET COMPRESSION, causing the first ALTER to fail and abort the transaction, cascading failures to all subsequent columns in the same transaction block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
LZ4 compression was first introduced in PostgreSQL 14 should we check this? |
Summary
Closes #35186
Two PostgreSQL storage optimizations implemented as startup tasks with corresponding
postgres.sqlupdates for fresh installs.Hot-rodding the DB
permission_referencetable is a cache. It gets flushed and rebuilt when dotCMS caches get flushed. Perfect candidate for unlogged. We are already running this in one of our largest customers environments.What was done
permission_referenceto UNLOGGED — eliminates WAL overhead on a regenerable permission cache (~2–3× faster permission rebuilds)Test plan
Task260403SetPermissionReferenceUnloggedruns andpg_class.relpersistence = 'u'forpermission_referenceTask260403SetLz4CompressionOnTextColumnsruns and spot-checkpg_attribute.attcompression = 'l'oncontentlet.contentlet_as_jsonandtemplate.bodyforceRun())postgres.sql— verifypermission_referenceis UNLOGGED and columns show LZ4 compression🤖 Generated with Claude Code