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 1vs7J7-006WR5-11 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 22:43:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vs7J3-006ETt-2n for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Feb 2026 22:43:06 +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 1vs7J3-006ETj-1o for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 22:43:05 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vs7J1-000000015xC-32Ph for pgsql-hackers@lists.postgresql.org; Mon, 16 Feb 2026 22:43:05 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-65808bb859cso4655589a12.2 for ; Mon, 16 Feb 2026 14:43:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1771281783; cv=none; d=google.com; s=arc-20240605; b=BmaWsRbUdkw4Nn2k50X+MwZProT/M+VE3aSVbF4B5YfRwD4nk2yUminJY3kRT9LXL2 mUBVyAZ8H5AoT2pEDbY6zDXINcK+WaQXi4/u7d/b6XeFZhQEkAhnxv9xhGh3ODDpHRA6 N9NlLZSmZeYM0zURbARZaf4sUZAlR0ev5IsQs2GlVbrT4T5FfOsOqFJvgvotJKuY56rH u5W3GCxNir4GHJ4wDY9VDGyXwd29MKJ/HAlskR9gogUbN/kV5uNkeJGuLNYwyaSmymow FyLruuNapUC2p7ntIEIYfYXJmnpp3YrIB3v9Gxsm4z6KXAiweIRDwYCs49JgdzcRsQjr kvhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=+Ba/Bxub6UBvL3nId5cGlteuuNaHqjJbRk0ath+XWzA=; fh=GwFQ9I0lOeCDjkxBubf15QlipT/CkXYgBQnVN8ZjVBU=; b=izXfufViUnCxZ8hqaTNPaekvEYdCw2ffqs/lcURybKz/jrpSWlkRawwBhTm/H6ESE4 Yxhe8COn7fs5ofWVqnteAUU7OHMbZaexfU3LAL5FIFb4eueP9oyYI0zW4OPenK4MgOYp 3kacaRBLLyOjYitH7xB5v+bOJJz8am8xNehRHHvq7MtXAI9gtG5qDRgCj5AKT9iWvrDZ fkuRLOhl1kay9Ob4vQDDC8+AyJPNQP0x54o2gplDx2tXzvSth5ctjy1pTKurQzA9qZKt plyCL/oSRX86hojeiFk0+oI6HkVtJ18HWnCjLurS/EOhwvVdNKDOo745MtnN0ayyHPbN rWYw==; darn=lists.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=1771281783; x=1771886583; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+Ba/Bxub6UBvL3nId5cGlteuuNaHqjJbRk0ath+XWzA=; b=iop3wTKEAtcVM4rJVWaMeNjwY21yLgOxvIgZKtp4xlqeLMNrYrqFWEVl9CQszGnQjD 8vFgfJ9GVabK51cGCWB4Vl6Q/nWRiRzgD+Rd31+MZ6QTlPlxAZXLhhRkoW55P33s32PR He1/T3IQ9S+WpdgFgSgEYtFZk3sOBW3sRBkNwFwHFJpaSQccXPlrngNoq154v5p/TA2f SNcHSOqPCIcfHeXkhD2Ae4ADUoM/6bwYUtkTg6WiZUHmuqxYAU1S3PGBT18cXstUFv/L aumbfAHqNf5FJLAyYth0QpHwVbp/dSYjTQqcmogzQLoXpMaV8wtsinIA+VoLcPjudiPc /Jpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771281783; x=1771886583; h=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=+Ba/Bxub6UBvL3nId5cGlteuuNaHqjJbRk0ath+XWzA=; b=tWzVnkfslSwCMcYNuo0bGji3e1xY0rJwNxVuHT+0Yphj8XrQ+qEWGux3fSjVgcYe72 PCqz9gPlVoPp3wjeFNbnZNX4kdEdWP/pT4P3HJeClf0ElVKrtStQePsaOzlKmP4Bfh3o YMKqrv+SHUtZEhbNmUz+R+LcC01cKmf36HrpaVWvhZJ4QbalStreXRhHDpoyBSI/bZNK kBAUvl9ZtEje1R7LA2PWser+NnptInbdSN+eVDDLn6/L1bvjHFt88qHvjt5r2XNXqPG+ 9X3cTFSa7VKtavKDN16x8CcSOBedl0LTffNXLwOUxQiWDH/iolvaOTyH/GKiPwTkgozF 6qSQ== X-Forwarded-Encrypted: i=1; AJvYcCW0DNFpGjTqYS3PgPdxswF1Hp1JD9Bty1eLuzixstNI67cvqFc7iIKXd/MYdpoeOtMMO2FpTebUwVZ09cKG@lists.postgresql.org X-Gm-Message-State: AOJu0Yw+QiCXrZeWuzVFeMkiV0XnybHQK/zrpADJ88Yey3g7GjFIV+w+ 634TDJqfqrifpq4TerxnhzLSFgFTEyZYkYkGgh45U/Wg7d/I9O2wsrXE0qQ8/JdBbMRCKxnY81b YmVq1y2QRCbJdgKT0NnsD5xxtsxcnFhY= X-Gm-Gg: AZuq6aLpqkffXQdGWsztNWjfLPiI61jVqc3Df2l1mjfn2m7zt0RYdR8aDKK9tJwdpIb 2YSAfmXf18Yv4GSPSI03CgCEEZcN++RAID6umkdyurJgHlEWhXL7FektkFUu7A8XXiMgkywPL64 GgRKxVm3nqu1HoAn5OovxGovrTjvvpCKpB/i7AVy8JS/WjZNLX/e3oU9zj6dI0jey6jZlPX4sC/ 8Xb3/5UQ4G9vYsBxp+z1FmH7Oz2VM5EAy+1h7L8ukKq56vEWOr64q5a+jESezDqXTslfDIYmPPO l5k= X-Received: by 2002:a17:907:6d11:b0:b8f:6f6d:c5de with SMTP id a640c23a62f3a-b8fb449c183mr670767466b.33.1771281782278; Mon, 16 Feb 2026 14:43:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Mon, 16 Feb 2026 16:42:50 -0600 X-Gm-Features: AaiRm5234pSTHxlVCDqEr64o0a-FaIlAbIol9A-dFzs-pnRe9LKN3E-cnSsw__A Message-ID: Subject: Re: Flush some statistics within running transactions To: Bertrand Drouvot Cc: Michael Paquier , Fujii Masao , pgsql-hackers@lists.postgresql.org, Zsolt Parragi Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks! > > 2/ > > I don't see we have tests for other timeout based GUCs, but it would nice > > to ensure that this woks correctly. Maybe as a custom_stats test where we > > SET stats_flush_interval inside the transaction and make sure the stats flush > > only after the new timeout has passed. Maybe? > > Not sure I follow, that's what 0002 is doing. I was referring to "SET stats_flush_interval", which you are doing in 0005, so disregard this comment. I wrote this comment when I read 0003 only. > > Will this be tue at all time? Let's imagine a Kind that flushes all the fields > > ANYTIME, would we not want to delete the pending entry? > > > > + /* if successfull non-partial flush, remove entry */ > > + if (did_flush && !is_partial_flush) > > pgstat_delete_pending_entry(entry_ref); > > > > Right, and that's why the MIXED flush mode was useful, i.e to be able to distinguish > here. So, in the attached, instead of re-introducing the MIXED flush mode, I added > a "is_partial" bool paramater to the flush_pending_cb(). > Yeah, MIXED flush mode to deal with this is still not the right idea, IMO. I do agree with what you did here by passing "is_partial" to the callbacks. Now it will be up to the callbacks to determine if they performed a partial or a complete flush ( even in the case of any anytime flush, if they so happened to flush stats for all the fields ). I do not have any further comments on this patchset. -- Sami Imseih Amazon Web Services (AWS)