You should be having this index: create index updates_driver_time_idx ON updates(driver_id, "time" DESC);
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных