Hi Zsolt, Thanks, both are real. v10 is attached.
> 1: there's a window for a permanent statistics leak when a tablespace > is dropped. Fixed. A flush only looks up the entry now. If it is gone, the counts are dropped. CREATE TABLESPACE creates the entry, as you suggested. That alone misses pg_default, standbys, and everything after a crash. So a process also creates it the first time it counts something for a tablespace. A relation or a temp file in the tablespace is in use at that moment, so it cannot be dropped. Your spec is in the patch as an isolation test. > 2: Are you sure the transaction move behavior is correct? No, it was wrong. Counts from before the move now go to the old tablespace. The test checks both tablespaces. Andres, counting a block time is now an add into a small local array. v9 did a hash lookup each time the tablespace changed. The only lookup now is when a tablespace is added to that array, once per tablespace between two flushes. Thanks, Shihao
pg_stat_tablespace-v10.patch
Description: Binary data
