# Are we storing the same truth multiple times?

Prompt · Schema and dependencies · PG11

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

## Prompt

```text
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.

**Tools:** Repository and read-only database access.

**Works on:** Any PostgreSQL host: Supabase, Neon, RDS, Cloud SQL or self-hosted.

**Changes:** Changes nothing

**Sessions:** Look first, then fix in a new session

## Related

- [Two systems that disagree](https://atlasscope.dev/prompts/two-systems-that-disagree): Finds data kept in two places (a saved copy and a table, the browser and the server) that can quietly disagree.
- [Where did this number come from?](https://atlasscope.dev/prompts/where-did-this-number-come-from): Checks that every number on screen can be traced back to a source document.
- [Map every place that writes to the database](https://atlasscope.dev/prompts/map-every-place-that-writes-to-the-database): Several jobs, functions, APIs or agents change the same data, or nobody is sure who owns it.
- [Which database objects no longer earn their keep?](https://atlasscope.dev/prompts/which-database-objects-no-longer-earn-their-keep): The list of views, functions and triggers has grown hard to reason about.

Source: https://atlasscope.dev/prompts/are-we-storing-the-same-truth-multiple-times
