How to improve the performance of timescaledb getting last timestamp
问题 SELECT timeseries_id, "timestamp" FROM enhydris_timeseriesrecord WHERE timeseries_id=6661 ORDER BY "timestamp" DESC LIMIT 1; (The table contains about 66m records, and the ones with timeseries_id=6661 are about 0.5m.) This query takes about 1-2 seconds to run, which I find too much. If it was using a simple btree index, it should locate what it's looking for after about 30 iterations. As far as I can see when I execute EXPLAIN ANALYZE for that query, it does use the index, but it has to do so