Open divergentdave opened 1 year ago
We could also write a query for postgres_exporter to load the idx_scan counts into Prometheus. That would let us look back over a few hours or days with a rate()
query and identify any idx_scan values that have stopped increasing.
We should review our indices from time to time to see if there are any that are not being used, either due to code changes or unexpected query plan behavior. Here's a query to use as a starting point, and its results on the staging database. (We ought to try this on a database with more tasks and with use of both query types, plus fixed size time bucketing, before drawing any conclusions) This query ignores primary indices and unique indices, because those are always being used on inserts even if they are never scanned.