Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 MySQL 中有一个大型数据集,我想在读取数据时加快 select 语句。假设有 1000 条记录,我想发出一个 select 语句,例如检索其中的一半,但基于时间戳。
使用这样的东西是行不通的,而 id 与时间戳不紧密耦合
select * from table where table.id mod 5 = 0;
检索所有数据然后选择所需的数据不是解决方案,而我想避免检索大型数据集。因此,我正在寻找能够在选择时区分记录的东西。
谢谢
如果你需要速度,那么试试这个
select * from table ORDER BY table.id DESC LIMIT 0,500; select * from table ORDER BY table.id DESC LIMIT 500,500;
等等...