In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Database table design optimization:
Sometimes in order to improve the efficiency of the database, we can properly consider the anti-three paradigms, add redundant fields appropriately, and reduce multi-table disassociation queries.
Use the index:
2.1 Database tables should be designed reasonably to use general index, primary key index, unique index, full-text index and composite (combined) index.
2.2 when the index is created:
(1) Fields that are more frequently used as query criteria
(2) for fields with poor uniqueness (such as gender / status fields, etc.), even if we frequently use them as conditions for query, it is not suitable to create indexes.
(3) the fields whose data are updated very frequently (such as the current online population field of the statistical platform / the sales quantity field of goods, etc.) are not suitable for creating indexes.
2.3 for the use of the index, please see: http://yaowusheng.blog.51cto.com/11020801/1853754
Note: creating an index requires overhead and takes up a certain amount of disk space; it is difficult to move the index data; in order to maintain the index file, it will slow down the operation of adding, deleting and changing. Do not overuse the index. It is very important to use the index properly.
3. Select the appropriate MySQL storage engine:
3.1 myisam Storage engine
If the table is not transaction-oriented and focuses on query and addition, consider the myisam storage engine (such as bbs's posting table and reply table)
3.2 innodb Storage engine
High requirements for transactions, saved data are important data, it is recommended to use innodb storage engine (such as account tables, order tables and other important tables)
3.3The memory storage engine
Data changes frequently, does not need to be stored in storage, and is frequently queried and modified at the same time. Consider using memory storage engine (Note: the inserted data will not be persisted to disk space, but will be temporarily saved in memory. If closed, the data will be lost.)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.