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.96) (envelope-from ) id 1w24lv-000rF2-2e for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 10:02:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w24lu-0098s3-2V for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 10:02:03 +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.96) (envelope-from ) id 1w24lu-0098rv-1c for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 10:02:03 +0000 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w24ls-00000000P6e-3dmu for pgsql-hackers@postgresql.org; Mon, 16 Mar 2026 10:02:02 +0000 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-4042fe53946so1625766fac.3 for ; Mon, 16 Mar 2026 03:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773655319; cv=none; d=google.com; s=arc-20240605; b=A2t+jarEZqy1QThwYl+Mq1atFtRxY7MurpN9bAnvFp+7taGLIK7ogDBarF7X5YsuZ8 OzQ/24Nnew3A2uAM9Gbi09jdW5Rhi3hZhQx6sW59nIwjdVEGYqJ/15nOI8iYVophFEPj slEfzK7snKmOAe1FZflBsaGPjn2F3dlssTZcwBpZxODmnP/r2PMSaM4nf3Soj/9iChu/ QZy+yB9XqN7CVc0FSXioh5TFoe3M8jH5LvSh5e8xsRhVpSTa0zxappZaasPnXzssOP/y 8qEDCnGqcIs96zG8QzE1YP1Q8Yk2g22zI4fppqiivDyaLuNTeb42cpj90CmbIj91UIs3 qcSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=m4J5NcoX04+k/CdTY8DtvzWRE7LLiU5KW04ednp6FjU=; fh=6RlhcHKMprORx2h9M0ImLhjkRcl3mNqLjpkZD7Kd0dA=; b=ilau6EaaQ71tTqvgjbNhpuzr8B1JJPIt4t2KTyd5rmdq0kA+hPOMo5ftV0cpWJvygk iqlzJ1tCTlUzRidrnPNzNR8+dpfFcShYvNTyVGCEC4K9NyX/Sak/hgPSCadc3NRijAj8 SOqnhy7a4c4bPAvYWg6tx9P706FfDwJszqgsUxctWk7vbkM8FXFmdijdVaGsXy9lefgr oHTm5lE4ay/LT98uy68U2oQl3vu1uA5n2nR0opkTj3BBDyxTaxJr8cYjWCwzb59bssys xGGCF6HpqHpKHraUYZlFpp26UYSgJY2s3l9bwgMw9DXX4AQVmX/+RvWoYizw8EwwY6iU Wg5w==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773655319; x=1774260119; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=m4J5NcoX04+k/CdTY8DtvzWRE7LLiU5KW04ednp6FjU=; b=DyWugRo2LIaFy/mrDt6hRdlKTouTT/gXWFWWtcV1+PCNt+eSs10v/jSNeqB4aiQCKy RmI6/k3VXWgiTd8fcW2uzAy7kRU9qX0xzsmYSkp/NyX1I2/WOcfiqm9Rmxl1zKHT2OH3 SLJr8wh3FzTx+CvqLMF8JTuRjHBtWJ+GSB+WDQtEP7QrveDx2zbq1xcKz/ka9iCQ2xag 9AB3sicwDyURFKcfSIAb8wTErvQL0wN5LNIFbbefvj0GDlvyIamZo0hQ1YtrFIxoKEWI +kD7nwTvvndXNs7LkVKJJ5L9z/ok+mW4inwdk5a2bTQsVDcXbOwR6oV9R47kWH6pXsSE iJaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773655319; x=1774260119; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=m4J5NcoX04+k/CdTY8DtvzWRE7LLiU5KW04ednp6FjU=; b=DuPeCETMsDimcjCfLvUJBGLfIYbmeCZfQCe30DM20xkZOOwkX74dHIB7jJx79asiIT bS3xVGjJRpZAVSnrH//PUw9cA24Kmqhfp5I2Itc59TeoQUJsq+JEucq9QsGPGwjJzP4J 3qwQWHVwMSeVvAWZ9Pg8NnfBB9LgdoqEjG5nawtSShGDVy1Wi24E4tiwmxDBnF+VqByd mMx/iH/vzKnGWFLcRzDUJxErgghm0aJm6x8z4iXR0x8v8RDf07K7defiZ0Nf0a6REF4F zFH0m6oPcUS4UuQl2ZrQvXyQBHS2s7lUu3VzmeMYJXuJCMpGzoJPCvD/IYZU/Ne083iW 2ZIw== X-Gm-Message-State: AOJu0YwILl2G24uII5j/wQQiMWdWVz8SES8JV0KHkDCpVxPvK7lSZICk gxO12Ysour5fPpc2APaWpE+s7SO/xhT4l71sqZyGaXUON+LxREpM35IwJyFHBVtsU2/Pce0h2ck S04nBb+zslE238SoiloftO9drjy0Tm9c= X-Gm-Gg: ATEYQzx0aOKr3RdhkrXCIIS9T7HT3k75UCaq/76KPWl+/QHEi5WtXO5iLKGCT46Trlo /Gz8C2iIgBE5vCpk7BbcyUTQAcLdhp/HetX2IAvQOxE/ltEt485ch1C1Rquwdr7KIXaS5twQVf+ 0u0T61BbJkXWANJzjv25p7SSfz5+6N9pOpw/3dCptwheJBRpG9DczPr2t0VoPiOWoDRp8WvdzxN 5rSipMK/Se2L5Anc4wjakBBXxlrS2VIK8NtrL+toFb9N/0taX4MUrzMmqVCaLiZ5CP31eHGsOIk 9eut9Rlz9vTq88jPt9bhpJDFmjSR1uRkcFHqBo6rGQ== X-Received: by 2002:a05:6820:616:b0:679:de02:774c with SMTP id 006d021491bc7-67bdaa888f7mr7530387eaf.67.1773655319217; Mon, 16 Mar 2026 03:01:59 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fujii Masao Date: Mon, 16 Mar 2026 19:01:47 +0900 X-Gm-Features: AaiRm53KTd_smWdpRZK9VK3eQkH306XJ07HNm2_7Fm7yQCE2G-CvufnY2glixUk Message-ID: Subject: Re: Add missing stats_reset column to pg_statio_all_sequences view To: Sami Imseih Cc: pgsql-hackers , shihao zhong Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 16, 2026 at 5:27=E2=80=AFPM Fujii Masao = wrote: > > On Fri, Mar 13, 2026 at 11:52=E2=80=AFAM Sami Imseih wrote: > > > > > it would be better to verify that the stats of the specified sequence= are > > > actually reset by using pg_stat_reset_single_table_counters(). > > > > > > Also, the documentation for pg_stat_reset_single_table_counters() sho= uld > > > mention that it can reset sequence statistics as well. > > > > good points. > > > > For the documentation of pg_stat_reset_single_table_counters(), I also > > mentioned materialized views for completeness. > > Thanks for updating the patch! > > I made a few cosmetic changes and pushed the patch. Thanks! Hmm... buildfarm member crake reported a pg_upgradeCheck failure, and it se= ems the test I added last time is causing it :( --- /home/andrew/bf/root/HEAD/pgsql/src/test/regress/expected/stats.out 2026-03-16 04:27:05.805748763 -0400 +++ /home/andrew/bf/root/HEAD/pgsql.build/testrun/pg_upgrade/002_pg_upgrade= /data/results/stats.out 2026-03-16 05:17:15.460202339 -0400 @@ -1196,7 +1196,7 @@ FROM pg_statio_all_sequences WHERE relname =3D'test_seq1'; ?column? | ?column? ----------+---------- - t | 0 + t | 1 (1 row) The test assumed that blks_read and blks_hit in pg_statio_all_sequences wou= ld be zero immediately after calling pg_stat_reset_single_table_counters(). However, on crake, either of them became 1 even right after the reset. This might happen if another process (e.g., autovacuum) accesses the sequence in the short window between the reset and the query of pg_statio_all_sequences??? More investigation would be necessary. Since checking the blks_read and blks_hit counters in pg_statio_all_sequenc= es can make the test unstable, I'm thinking of removing that part of the test. Regards, --=20 Fujii Masao