首页
开发手册
应用中心
工具
用户中心
FoundPHP Database Optimization
English
中文简体
English
上一篇
下一篇
### FoundPHP Database Optimization FoundPHP is an extremely simplified framework with extremely high execution efficiency. As mentioned before, the database has a relatively large impact on performance, so the performance will not be affected in regular use, but if the page is more complex or the execution data is large, the execution performance is guaranteed at the same time To make the data complete, this is a more complicated problem, and we need to optimize it. #### 1. Database structure optimization When designing a database, try to reduce the number of tables in the database and increase the reuse rate of the database, which can effectively reduce the statement of the database, and the fewer database statements can increase the occupancy rate of the database. #### 2. Database Index After the database data is 100,000, the database query will slow down when querying the database table. We add an index to the query database field, which can improve the indexing efficiency of the database, which can improve the query efficiency of the database in disguise. #### 3. Database Cache There is a large amount of duplicate data in the commonly used data in database query, and the duplicate data can be cached. The cache usually does not cache the user information. `Privacy data do not cache`. The cached data is usually in the `data` directory. For example: the menu at the back of the system, the menu at the front end of the website, contact information, etc. This kind of information will cause the project to slow down every time the database is queried. We make these data into a cache, and every time the cache is called, only the first compilation takes time, and the other time is to call the cache. The access speed can naturally be increased by several times. . ![](data/files/edit/21/06/22/210622_17517584.png) Specific Usage: [http://www.foundphp.com/?m=manual&id=1764](http://www.foundphp.com/?m=manual&id=1764 "http://www.foundphp.com/?m=manual&id=1764")