Prompt·Schema and dependencies·PG11

Are we storing the same truth multiple times?

Caches, aggregates, materialized views or derived columns drift from the raw facts.

Markdown
Prompt
Find concepts and values maintained in multiple tables, materialized views, caches or derived columns. Trace which representation is authoritative, why each copy exists, how it stays synchronized, and what happens when the copies disagree. Recommend which duplication is justified by performance or history and which should be removed.
What it returns
The authoritative source and each copy, how each is refreshed, examples of drift, and what each copy costs readers and writers.
Skip it when
Each fact is stored once.
Avoid
Rejecting all denormalisation. Copies kept for speed or history can be worth it.
Changes
Changes nothing
Sessions
Look first, then fix in a new session
Tools
Repository and read-only database access.
Works on
Any PostgreSQL host: Supabase, Neon, RDS, Cloud SQL or self-hosted.

Related prompts

More in Schema and dependencies.