Some skills set development of large databases

Large database design skills

1. Categories split data amount table. For frequently used tables (e.g., certain parameters of the code table or the table), because of their high frequency of use, to minimize the number of records in the table. For example, the bank's head of the household accounts table originally designed as a table, although you can easily design and maintenance program, but after analysis, because the data is too big, it will affect the rapid positioning data. If the head of the household accounts table for the current head of the household accounts were designed, regularly head of the household accounts and the public head of the household accounts, etc., it can greatly improve query efficiency.
 
2. Index design. For large database table, a reasonable index can improve the operating efficiency of the entire database. In the design of the index, the index field values less should be selected duplicate field; when built on a composite index field is retrieved, it is noted in the order established by the composite index field. For example, if the serial number and the date for the order to the establishment of a composite index of more than 50,000 flow table records, duplicate values due date in the table records the number of the entire table is close, the time used by the serial number query close 3 sec; if the same index as the index field in a query serial number, used in less than 1 second. Therefore, large database design, the only reasonable choice index fields in order to effectively improve the operational efficiency of the entire database.
 
3. Optimization of data manipulation. In large databases, how to improve the operational efficiency of data concern. For example, each additional table in the database a business flow, the water must be removed from the serial control table, and the value of the serial number plus one. Under normal circumstances, the reaction rate is still normal single operation, but when using it for batch processing operations, the speed will be slowed down. The analysis found that, for each value of the water control table serial number plus a time to be locking the table, and the table is the core of the operating system, there may be locked by another process in the operation, thus making the whole transaction speed operation slow. To solve this problem is to apply serial number based on the total volume business of bulk items, and water control table update, you can increase the speed of batch business processes. Another example is the optimization of the interpolation table. For high-volume business processes, if inserted in a database table using the Insert general statement, the speed will be very slow. The reason for this is that the table should be inserted once every I / O operation, it takes a long time. After improvements, may be I / O operations in the form of a buffer, etc. Put the statement after full page, thereby increasing efficiency. When large database tables removed, usually directly Delete statement, this statement although the operation can be a small table, but because it will bring a large table large transaction which led to very slow or even fail to delete. The solution is to get rid of affairs, but more effective approach is to first conduct Drop operation then rebuilt.
 
4. Adjust the database parameters. Adjust the database parameters is a process of accumulation of experience, should be experienced system administrator complete. To Informix database, for example, the number of record locks too little will cause the failure of the lock table; the number of logical log files too little will cause failure insert large table, these issues should make the necessary adjustments based on the actual situation.
 
5. The necessary tools. In the entire database development and design process, you can first develop some small application tools, such as automatic generation of database table headers, insert data initialization, data insertion function package, the error tracking or automatic display, in order to improve the database design and development efficiency.
 
6. Avoid long transaction. Bring a large transaction for a single large table delete or insert operation will be, the solution is to adjust the parameters, you can split the file at the time of insertion. For a long transaction (such as the date of the final transaction banking transaction system), the entire transaction can be completed by a series of operations, but its drawback is possible because the entire transaction can not be completed together constitute too large of a series of small transactions operated by the order, or, since the chance of accidental affairs redo the time required for too long. A better solution is, the entire transaction into several smaller transactions, then the process by the application program controlling the entire system. This way, if a transaction is not successful, just redo the transaction, which can save time and avoid long transaction.
 
7. Appropriate advance. The rapid development of computer technology, database design must have certain forward-looking, not only to meet the current application requirements, but also of future business development, and must be conducive to expansion or increase the processing functions of the application system.

Reproduced in: https: //www.cnblogs.com/in-loading/archive/2012/02/17/2355268.html

Guess you like

Origin blog.csdn.net/weixin_34203832/article/details/93700333