通过sql 查询自增id 跳跃丢失. 用于手工插入


mysql> explain select t1.* from trade t1 left join trade t2 on t1.id+1=t2.id where t1.id > 71170675 and t1.id <= 72170679  and t2.id is null limit 1;


无法使用索引

mysql> explain select t1.* from trade t1 left join trade t2 on t1.id=t2.id+1 where t1.id > 71170675 and t1.id <= 72170679  and t2.id is null limit 1;


你可能感兴趣的:(sql)