Course contentsShow
← Data Science
Lesson 1074 of 2,14527. Database Design and OptimizationFree lesson

Duplicating Data Across Tables

Learn when and how to intentionally duplicate columns across tables to reduce JOIN complexity in queries.

Duplicating Data Across Tables

You'll learn when intentionally copying columns across tables can actually improve database performance by reducing JOIN complexity.

The Core Idea

In a perfectly normalized database, every piece of information lives in exactly one place. But sometimes strategic denormalization—copying the same data into multiple tables—makes your queries faster and simpler. This is especially valuable when you constantly need specific information from related tables.

When Duplication Makes Sense

Imagine an orders table that needs customer names for reports. In normalized form, you'd store only customer_id and JOIN to the customers table every time. But if you run thousands of order reports daily, each requiring that JOIN, you're paying a performance cost.

By duplicating customer_name directly into the orders table, you eliminate the JOIN entirely for most queries. Yes, you're storing the same name multiple times, but disk space is cheap—query speed isn't.

Common Duplication Scenarios

Frequently accessed lookup values: Product categories, customer names, or status labels that rarely change but are queried constantly.

Aggregated summaries: Storing total_order_value on a customer record instead of calculating it from order lines each time.

Historical snapshots: Copying current product prices into order records preserves what the customer actually paid, even if prices change later.

The Trade-off

You're exchanging storage space and update complexity for read performance. When customer "Jane Smith" changes her name, you must now update both the customers table and potentially thousands of orders rows. This works best for data that changes infrequently but is read constantly.

Key Takeaway: Intentional data duplication reduces JOIN overhead in read-heavy scenarios, but requires careful consideration of update patterns and data consistency requirements.