Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEXIm-0080iq-CQ for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 17:18:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tEXIk-00Aj8J-Jm for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 17:18:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEXIj-00Aj8B-Mz for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2024 17:18:38 +0000 Received: from fout-b4-smtp.messagingengine.com ([202.12.124.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEXIg-003JfH-RB for pgsql-general@postgresql.org; Fri, 22 Nov 2024 17:18:36 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 0E1811140189; Fri, 22 Nov 2024 12:18:33 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Fri, 22 Nov 2024 12:18:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1732295912; x=1732382312; bh=SlygsUM+vH2MViRX4GJw8bwH0rgGfU/P9280yI3E2R0=; b= JSdklx6g2ZOSn0gNc2L4nHrdiZJs2vYkaZuul0DeR6AlhMBlU9xHldadbmGJDz8j bRYYJOcErzy7yMpMnWdex9urOf6eM7OYI84owZ4YgOkIzsRtTHuL2tgz65EmVpA3 5ho/uoo35yLUdf8CwMA5k/vwETZbHBdpj5AXt1+2tuxMkIuwwI0KkeXVKZaqi6+0 VqswI4Ai93arvuCcGr4e9sLhEXSF54Q4SSz9fi54U5jViZG16bZvOY+3OQStt/qz 86GAJx5SqxWX22p84Ru3hYwnN27vP1kMYGb9PSyoIq7MTWFqC4z5wfGTioOF4+3w qe9ilZ4EpbSK9nIWMUqyfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1732295912; x= 1732382312; bh=SlygsUM+vH2MViRX4GJw8bwH0rgGfU/P9280yI3E2R0=; b=w 4Cg5AzYon0BrJv0vckCx2n1uvPfsN7Jo4NQp3Ry3NAjwu4EkJ1qf6ub+q9FsyCqF V6OzGLVxWFhRmNv3N12j9cWR4KdogUqgPH3QU0nXX7wbbdDwPotD5i8C7+5yCdOh J6qt8tFlvSeerBSFH6CXeqqn6jazJPwDGsHRNJZ/MmJh+IzP5vsDpKkJoxmb4qoS 1jp/4Bgu0CrWIt5GUzgxiTJjt7i/w6jrr+DXVH1fzX2mCXxS/zu2ujyoFUpwG7Zc sTUvVDcTfg402nuDmWtV5chi6xa9c2o80xe/WA3WtEdMhvbdXQ8uAOb4CMCWfWrV HzGZ1B9FLPw3dW9tnLfmQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeelgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeefgeefieeutdfggfetgefg heekjeehteeileeigfetieekjedvieeviefgheevtdenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehssghouhhlrghnghgvrhdvleesghhmrghilhdrtghomhdprhgtphhtthho pehpghhsqhhlqdhgvghnvghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Nov 2024 12:18:32 -0500 (EST) Message-ID: <9a0d0e80-13e1-421a-9d84-da000fe4433a@aklaver.com> Date: Fri, 22 Nov 2024 09:18:31 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Database stats ( pg_stat_database.stats_reset ) get reset on daily basis - why? To: Steeve Boulanger Cc: pgsql-general References: <6a157286-5948-48ac-bc50-7bb4e65ee5e5@aklaver.com> <38725031-5e80-46ee-b403-a92107b24c39@aklaver.com> <1e2db3f5-00f4-4ec2-800f-46136c2fad59@aklaver.com> <1270021b-c5b5-4ca8-b48d-7dfb163bb6f7@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/21/24 15:50, Steeve Boulanger wrote: > > 1) Do the 77 share some trait the other 80 don't. > > No pattern found yet .. but still verifying a few things > > > 2) Do the OS system logs reveal anything? > > Nothing found in syslog > > > 3) What was happening in the databases just prior to the time the stats > reset? > > Here's an example (log extracts) for a stats reset occurrence: > > select datname, stats_reset, now()-stats_reset as since_reset > from pg_stat_database > where ( now()-stats_reset ) < interval '1 day' > order by 3  limit 1; > >     datname     |          stats_reset          |   since_reset > ----------------+-------------------------------+----------------- > MyDB           | *2024-11-21 13:48:34.332*785+00 | 00:00:22.266304 > > <--LOGS--> > 2024-11-21 13:48:34.324 UTC pid=[322035][2]  db=[MyDB] usr=[user1] > client=[host1] app=[[unknown]]LOG: connection authorized: user=user1 > database=MyDB applicatio > n_name=app1 <..> What is the [2] referring to? > > <.. no calls at "2024-11-21 13:48:34.332" - WHY?? ..> My guess is the difference in time it takes to log the action and set the log timestamp. Whereas the stats_reset value is the timestamp when the stats system actually did the reset. > > 2024-11-21 13:48:34.336 UTC pid=[322035][3]  db=[MyDB] usr=[user1] > client=[host1] app=[app1]LOG:  duration: 1.071 ms parse : > SELECT <..> The above is some garden variety select? -- Adrian Klaver adrian.klaver@aklaver.com