表结构的优化,建索引,sql语句优化
1.最左原则,建立索引的字段,在查询的时候,判断表达式紧贴where。2.能使用联合查询,就不用嵌套查询(子查询)。3.不使用*来进行查询。4.数据量大的时候,不在使用外键。5.利用redis缓存来解决数据库优化6.主从热备份