Using timescaledb. I have a query like this
select time, interface,(bytes_recv - lag(bytes_recv,1) OVER (partition by interface order by time) from net where host='foo' and interface in ('bond0','eth0') AND time = '2023-01-01" group by time,bytes_recv,interface order by 1
It should return like 1000 values. It takes me over 3 mins to execute this query…
i verified that there is a btree+ index for time.
Anything else I should be checking?