#SQL

MySQL执行计划分析

<h3 id="mysql执行计划分析">MySQL执行计划分析</h3> <table> <thead> <tr> <th>列名</th> <th style="text-align:center">含义</th> </tr> </thead> <tbody> <tr> <td>id</td> <td style="text-align:center">id列,表示查询中执行select子句或操

SQL优化技巧总结

<h3 id="sql优化技巧总结">SQL优化技巧总结</h3> <p>汇总如下:</p> <p>分解SQL</p> <p>查询切分 最典型的案例就是分页查询</p> <p>永远为每张表设置一个ID主键</p> <p>避免使用SELECT *</p> <p>为搜索字段建立索引</p> <p>在Join表的时候使用对应类型的列,并将其索引</p> <p>尽可能的使用NOT NULL</p> <p>