我的表包含与对象相关的值的历史记录,它看起来像:
create table History (
object_id bigint NOT NULL,
value int NOT NULL,
date bigint NOT NULL
);
如何索引它以优化以下查询:
select * from History
where object_id = ? and date < ?
order by date desc
limit ?