MySql Performance Tuning (3) Table Design
I. first introduce several concepts:
1. full function dependency: in the relational mode R (U) of the property set U, if X-> Y, and for any real subset of X ', if both have x' <> Y, Y is fully dependent on X.
2. Pass function dependency: In R (U), if X-> Y, Y-> Z, Z is called the transfer function dependency of X.
Ii. Paradigm
Relational databases have six paradigms: 1NF, 2NF, 3NF, BCNF, and 4NF ), 5NF ). Associations between various paradigms: 5NF ε 4NF ε BCNF ε 3NF ε 2NF ε 1NF
1. 1NF ):
Fields in the database table are single attributes and cannot be divided. The first paradigm meets the minimum requirements.
2. 2NF)
For rε 1NF, and each non-primary attribute fully depends on the code, rε 2NF.
3. Third Paradigm (3NF)
If a non-primary attribute neither relies on Code nor transmits code, R belongs to the third paradigm.
4. BCNF
Except for this NF, there is no other determining factor, that is, no loop.
Normalization process of the link mode:
Summary:During program development, the designed database follows the three paradigm to the maximum extent. The three paradigm joins many tables during queries, resulting in reduced query efficiency, so that sometimes, in order to improve the query efficiency, we can moderately redundant and moderately reverse the paradigm.