Database normalization

I am creating a query, and as I create it, I understand that it would be easier to write if some tables contained redundant fields; this would save a few pools. However, this means that the database model will not be fully normalized.

I strive for performance; will a denormalized database hinder performance? I am using SQL Server.

Thank.

+3
source share
7 answers

I don’t know exactly what your implementation is, but usually it helps to have redundant links to the index, but not redundant fields as such.

For example, let's say you have three tables: tbl_building, tbl_room, and tbl_equipment. (Equipment belongs to the assembly room)

tbl_building , tbl_room roomID buildingID. , tbl_equipment roomID buildingID, roomID.

, , , field buildingSize tbl_building buildSize tbl_room tbl_equipment.

+1

- , . , .

:

  • ,
  • //
  • ( ).

, .

; , .

+1

, , , , ( , , ) .

0

, , , .

: , , , , .

,

, , , , ?

0

, " ?", " ". - . , , ( ). , ( ).

0

. - .

( , ). . , , , .

0

The main goal of normalization is to reduce data redundancy in your tables, which reduces storage loss and mismatch. In terms of performance, it depends on how your database is created. If there is too much redundancy, then checking and searching for an element in relation will increase the search time and decrease the efficiency. On the other hand, if there is less redundancy, it will not have much effect on performance. But it is always better to have a normalized circuit.

-1
source

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


All Articles