pgstat_read_statsfiles() and reset timestamp

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pgstat_read_statsfiles() and reset timestamp
Date: 2020-05-13 12:06:15
Message-ID: b91b6ff1-6ef3-ee86-a713-c93978973c78@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

pgstat_read_statsfiles() sets each stat_reset_timestamp to
the current timestamp, at the beginning of the function,
just in case we fail to load the existing statsfile. This code is
originally introduced by commit 4c468b37a2.

But commit ad1b5c842b changed pgstat_read_statsfiles() so that
the stats including stat_reset_timestamp are zeroed in that case,
so now there seems no need to set each stat_reset_timestamp.
Thought?

Attached is the patch that removes such unnecessary sets of
stat_reset_timestamp from pgstat_read_statsfiles().

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

Attachment Content-Type Size
pgstat_read_statsfiles_set_timestamp.patch text/plain 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-05-13 12:21:50 Re: Inefficiency in SLRU stats collection
Previous Message Ashutosh Bapat 2020-05-13 12:04:17 Re: [PATCH] Keeps tracking the uniqueness with UniqueKey