1、如果A表TID是自增长,并且是连续的,B表的ID为索引

select * from a,b where a.tid = b.id and a.tid>500000 limit 200;

2、如果A表的TID不是连续的,那么就需要使用覆盖索引.TID要么是主键,要么是辅助索引,B表ID也需要有索引。

select * from b , (select tid from a limit 50000,200) a where b.id = a .tid;

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2021-08-14
  • 2021-11-18
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-17
  • 2021-06-29
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2022-02-03
相关资源
相似解决方案