server1db1rowcount = 10,000,010;
server2db2rowcount = 10,000,020;
server3db3rowcount = 10,000,030;
server4db4rowcount = 10,000,040;
server5db5rowcount = 10,000,050;
pagesize= 100;
rowcountall=server1db1rowcount +server2db2rowcount …;
pagecountall=rowcountall/pagesize;
如果请求第1页,
select * from db1 limit 1, 100;
如果请求第100,000页,
select * from db1 limit 100000100-99, 100;
如果请求第100,001页,查出来十条然后连接db2查询pagesize- server1db1rowcount %10;
select * from db1 limit 100000100-99, server1db1rowcount %10;
select * from db2 limit 1,90;
单表五千万数据行分数据库设计查询
最新推荐文章于 2022-05-22 16:27:11 发布