Get rid of pgstat_count_backend_io_op*() functions - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Get rid of pgstat_count_backend_io_op*() functions
Date
Msg-id aLWonxez0MBSqEvA@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
Responses Re: Get rid of pgstat_count_backend_io_op*() functions
List pgsql-hackers
Hi hackers,

This patch removes the functions that are incrementing the backend IO stats.

Instead, it now copies the IO pending stats to the backend IO pending stats when
the pending IO stats are flushed. This behaves the same way as for some relation
and database stats (see pgstat_relation_flush_cb()).

It's done that way to avoid incrementing the "same" counters twice as it produces
increased overhead in profiles (reported by Andres in [1]).

Please note that per-backend statistics have to be last when we define the
PGSTAT_KIND_% values in pgstat_kind.h, as some of their pending stats are
populated while other stats kinds are flushing.

[1]: https://www.postgresql.org/message-id/7fhpds4xqk6bnudzmzkqi33pinsxammpljwde5gfkjdygvejrj%40ojkzfr7dxkmm

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Jacques Combrink
Date:
Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue
Next
From: Bertrand Drouvot
Date:
Subject: Re: Per backend relation statistics tracking