by kebsup · 1mo ago · 0 comments
Including relevant columns in the index can massively improve the performance, because postgres does not need to read the randomly sorted tuple in the original table.
The indices will bloat in size (postgres does not vacuum them in the way a table is vacuumed), and begin to bottleneck primary writer latency.
You should repack the indices every once in a while (you can set up monitors on index bloat) with something like pg_repack, and make sure that your indices are minimally-sized (i.e. omit rows that are never scanned, use pg_stat to verify which indices are actually used by the primary or read-replicas).