Re: pgstat: Flush some statistics within running transactions, take 2 - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: pgstat: Flush some statistics within running transactions, take 2
Date
Msg-id CAN12+YJ_kS+bhLHXJJ9kYUS+_UZp5emNKuCZnE7YBVx1m1LJSA@mail.gmail.com
Whole thread
In response to Re: pgstat: Flush some statistics within running transactions, take 2  (Sami Imseih <samimseih.pg@gmail.com>)
List pgsql-hackers

The scan only performs one backend local bool write per pending entry, so this
is probably negligible compared to the actual flush work. A pass generation
could avoid the extra scan, but I'm not sure that would be worth the additional
complexity.

What do you think?
 
The scan only does one backend-local write per pending entry, so it is
negligible compared to the flush work itself. I benchmarked a
workload touching 1, 2, 4, 8, ... up to 512 empty relations per
transaction across 1, 2, 4, ... up to 256 clients, and did not see any
differences beyond noise of +/-1% tps differences.

Even so, I think the pass-generation approach is the better idea here. It's
slightly more code, but it avoids the extra full-list reset pass. I will feel
better with the generational counter.

--
Sami Imseih
Amazon Web Services (AWS)

Attachment

pgsql-hackers by date:

Previous
From: Floris Van Nee
Date:
Subject: Re: OOM kill during planning - pg_terminate_backend is ignored
Next
From: Antonin Houska
Date:
Subject: Re: REPACK (CONCURRENTLY) can crash a logical decoding session