What is denormalization and when would you do it?
SQLLevel: IntermediateDatabase Design
What is denormalization and when would you do it?
Hints
- Which functional dependencies hold between table attributes?
- Check insert, update and delete anomalies; what changes when the table is decomposed?
Answer
Denormalization intentionally introduces redundancy to improve read performance. You do it when:
- JOINs are too expensive for your query patterns
- You're building a reporting / analytical system where read speed matters more than write simplicity
- The data changes infrequently so keeping duplicates in sync is manageable
Common patterns: storing precomputed aggregates, copying frequently-joined columns to avoid a JOIN, using JSON columns for flexible attributes.
The tradeoff: you trade write complexity and risk of inconsistency for faster reads.
Source and licence: SQL Interview Questions — Arda Kocadoru · MIT