-1

I am having difficulty understanding how denormalization results in more storage necessary.

For example, let's say that in a normalized relation, there's Table 1 and Table 2. In order to join Table 1 and Table 2, I need another table Table 3 that maps Table 1's primary key to Table 2's primary key.

In a denormalized relation, I just include Table 2's primary key in Table 1 and no longer need Table 3. However, how does this require more storage? Instead of storing Table 2's primary key in Table 3, I just stored it in Table 1. And it should result in less storage, since Table 3 also included Table 1's primary key as its primary key.

2 Answers 2

5

Denormalization does not necessarily require more storage. Normalization requires more tables with primary and foreign keys, which may increase overall storage requirements. Denormalization typically requires you to duplicate some data, but you save on foreign keys, which may make up for it.

In your example, you will need to duplicate some rows in table 1 (all rows which have more than one match in the table 3), but on the other hand you save one of the columns in table 3. Whether this increase or decrease the overall storage requirements depends on the nature of the data.

0

Your understanding is flawed.

You need a junction table only if you want a many-many relation between the entities; it is not a requirement of normalisation.

Not the answer you're looking for? Browse other questions tagged or ask your own question.