Ad-hoc monitoring
In some cases, we need to observe some values in Postgres or the environment it's running on (OS, FS, etc.), and:
In some cases, we need to observe some values in Postgres or the environment it's running on (OS, FS, etc.), and:
Monitor and manage autovacuum queue, understand worker activity and vacuum progress
When connected to a primary (or standby leader in case of cascaded replication), one can use pg_stat_replication:
Modern ORMs like Rails or Django use int8 (bigint) primary keys (PKs) today.
To monitor the progress of long-running index building or rebuilding, you can use this query:
Transaction ID and MultiXact ID wraparound – one of the worst incidents that can happen with a Postgres database. Infamous cases:
Previously, we discussed how to implement monitoring for the risks of XID (transaction ID) and MultiXID wraparound.
In a fast-growing project, one of the important optimization vectors is reduction of the amount of WAL (Write Ahead Log) generated.
application_name is useful to control what you and others are going to see in pg_stat_activity (it has a column with the same name), and various tools that…
Learn how to troubleshoot streaming replication lag
There are two big branches of query optimization: