Java Knowledge Summary-21

Source: Internet
Author: User

A base table differs from an intermediate table, a temporary table, because it has the following four attributes:
(1) atomicity. The fields in the base table are non-biodegradable.
(2) Primitive nature. The records in the base table are the records of the original data (the underlying data).
(3) Deductive nature. All the output data can be derived from the base table and the data in the Code table.
(4) stability. The structure of the base table is relatively stable, and the records in the table are stored for a long time.
After you understand the nature of the base table, you can differentiate the base table from the intermediate and temporal tables when you design the database.

Database design paradigm;
The first paradigm: 1NF is an atomic constraint on attributes, requiring attributes to be atomic and non-decomposed.
The second paradigm: 2NF is a unique constraint on records, requiring records to have a unique identity, that is, the uniqueness of the entity;
The third paradigm: 3NF is a constraint on field redundancy, that is, any field cannot be derived from another field, it requires no redundancy in the field.

The way to prevent database design from patching is "three less principles"
(1) The smaller the number of tables in a database, the better. Only the number of tables is small, can explain the system e--r diagram few but good, remove the redundant
Entity, formed a high degree of abstraction to the objective world, and carried on the system data integration, prevented the patching style design;

(2) The fewer fields in a table combine primary keys, the better. Because the primary key function, one is to build the primary key index, and the second is the foreign key as a child table, so the group
The number of fields with primary key is less, not only saves the running time, but also saves the index storage space.

(3) The smaller the number of fields in a table, the better. Only the number of fields is small to indicate that there is no duplication of data in the system and there is very little data redundancy
More important is to urge readers to learn to "row", which prevents the sub-table of the field to be pulled into the main table, leaving in the main table
More free fields. The so-called "column-to-row" is to pull some of the contents of the main table and create a separate child table. This method is very simple.
Alone, some people are not accustomed to, do not adopt, do not execute.

Ways to improve the efficiency of database operation
Under the condition of the given system hardware and system software, the way to improve the operation efficiency of the database system is:
(1) in the database physical design, reduce the paradigm, increase redundancy, less use of triggers, multi-use stored procedures.

(2) When the calculation is very complex, and the number of records is very large (for example, 10 million), the complex calculation is first outside the database, the file system side
After the processing of the C + + language is completed, the final storage is appended to the table. This is the experience of telecom billing system design.

(3) If a table is found to have too many records, such as more than 10 million, the table is split horizontally. The horizontal split is done with the table primary key
A value of PK is a line dividing the table's records horizontally into two tables. If you find that there are too many fields for a table, such as more than 80,
Split the table vertically, decomposing the original table into two tables.

(4) The database management system DBMS system optimization, that is, the optimization of various system parameters, such as the number of buffers.

(5) When using the data-oriented SQL language for programming, the optimization algorithm should be taken as far as possible.
In conclusion, in order to improve the efficiency of database operation, it must be optimized from database system level, database design level, program implementation level, and the three
At the same time on a level.

Java Knowledge Summary-21

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.