当只要一行数据时使用limit 1用not exists 代替not in(不能使用索引,耗时较长)使用left join时where语句放到from后,以减少左边的范围,使用right join时亦然limit 的基数比较大时使用between尽量避免在列上做运算,这样导致索引失效