MySQL - Should I Denormalize?

Overview (Sorry, its vague - I think if I went into details, it would only complicate things)

I have three tables, the first contains an identifier, the second table contains its own identifier and one table identifier, and table three contains its id identifier and table two.

I spent a lot of time thinking, and I think it would be more efficient for table 3 to also contain a related table identifier.

-It will mean that I donโ€™t have to join three tables, I can just query table three (for a query that will be used very often)

-It will make it easier for me to implement a backup system by only locking the rows in table three that contain the specific identifier from the first.

For those who want to know more about the database layout, more details here.

Question

What are the adverse conditions for de-normalization? I saw some people who are completely against this, and others who believe in the right situation, this is a useful tool. The identifier will never change, so I really do not see any flaws, except for the need to insert the same data twice, and, therefore, the additional space that it will consume (which, since this is just an identifier, will certainly be insignificant).

+3
6

, : , , , .

, , . , - , , , , .

+5

, , - , .

. .

+1

, .

, . 3 2 ?

, , 3 self-id, table-two-id table-one-id, - , 2 -- 1 table-one-id 15 ?

. ...

EDIT: , -- (), --id .

+1

( 1) ( 2), ( 2) ( 3) , 3 .

.

  • 1
    • 2
      • 3

, , .

+1

, , . ( ), .

0

, , " ". , . " ", " " " ".

, , , , .

" ", , , .

, , . , , , .

I would refrain from "denormalizing" as a practice. This is like leaving Chicago. You still donโ€™t know where you are going. However, there are times when normalization rules should be ignored, as others have noted. If you are designing a star pattern (or snowflake pattern), you will need to ignore some normalization rules in order to get a better star (or snowflake).

0
source

Source: https://habr.com/ru/post/1722784/


All Articles