May 2018
Intermediate to advanced
576 pages
30h 25m
English
Look at the age of the oldest snapshots that are running, like this:
postgres=# SELECT now() - CASE WHEN backend_xid IS NOT NULL THEN xact_start ELSE query_start END AS age, pid, backend_xid AS xid, backend_xmin AS xmin, stateFROM pg_stat_activityWHERE backend_type = 'client backend'ORDER BY 1 DESC;age | pid | xid | xmin | state ----------------+-------+----------+----------+------------------00:00:25.791098 | 27624 | | 10671262 | active00:00:08.018103 | 27591 | | | idle in transaction00:00:00.002444 | 27630 | 10703641 | 10703639 | active00:00:00.001506 | 27631 | 10703642 | 10703640 | active00:00:00.000324 | 27632 | 10703643 | 10703641 | active00:00:00 | 27379 | | 10703641 | active
The preceding example shows an update workload ...