Re: [PATCH] Change wait_time column of pg_stat_lock to double precision
Tatsuya Kawata <kawatatatsuya0913@gmail.com>
From: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-06-15T13:12:08Z
Lists: pgsql-hackers
Hi Horiguchi-san, Thanks for the review! > since wait_time is only accumulated for waits longer > than deadlock_timeout, sub-millisecond precision was probably not > considered particularly useful. You are right that, given the deadlock_timeout floor (which is a GUC, but defaults to one second), each individual wait is already on the order of one second, so the sub-millisecond remainder is at most about 0.1% of the value being recorded. The precision argument is therefore weak on its own, and I do not want to insist on it. The primary motivation I had in mind is consistency across the statistics views: pg_stat_lock is the only one whose timing column is not double precision. Even if the bigint choice was deliberate, the view ends up breaking the pattern. If we decide to keep bigint, I think it would be worth documenting the reason explicitly (e.g. that wait_time is only accumulated for waits longer than deadlock_timeout, hence sub-millisecond precision is not needed). Thoughts? Regards, Tatsuya Kawata
Commits
-
Change stat_lock.wait_time to double precision
- ff6f6e0470ec 19 (unreleased) landed
- c776550e4662 master landed