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 1x3TAg-006S5k-36 for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Sep 2026 06:49:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x3TAf-00HOqH-2K for pgsql-hackers@arkaria.postgresql.org; Mon, 07 Sep 2026 06:49:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x3TAf-00HOq9-1N for pgsql-hackers@lists.postgresql.org; Mon, 07 Sep 2026 06:49:37 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x3TAd-00000004O4N-3E4f for pgsql-hackers@postgresql.org; Mon, 07 Sep 2026 06:49:36 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-49b8687630fso26687935e9.3 for ; Sun, 06 Sep 2026 23:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788763774; x=1789368574; darn=postgresql.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=h78rs5SRLrGtljJFiA7rDRhefTYy0CkyRtXiDeEP+y4=; b=nWAndELP9z4s7CTJxENSuOpJkkgMns3TkXftz4hvJtVRowa8xUT5C/D+IYub3r4VFo UjfKaQ7fB+O0GCa9ob8zHWycRAGkbzw30nWpueMZXNrGA4NsED7lqvs6TzVpohq8tyV+ 38YIgfQuIpFLyCJjYOWQArENCscjyynT8lLvbguSVa5ivSflKi66P7TLeUj3qbiyF/Yf RwY148/4RtKIbqlL1EGbaGoKjMs+zdC0fV0X0KcpVKrcXyyat+dc3/98CZe3exgHL33b 1yvgnURQDXkwF608PQmH96tjswFw1v1d8Buz2x4fvwA4yKh4SDJ7ajUlcmZozlHDkDlt +Ifg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788763774; x=1789368574; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=h78rs5SRLrGtljJFiA7rDRhefTYy0CkyRtXiDeEP+y4=; b=PBobWYLpPao/GTHK694Cb+oj9ikcEQu3PuIsh4HM/uS7CFRE3qw8IVrfqonCyDvasK TAIMtZl/cmHzWvP3MCqCf6PBFiYOZyEY3SR07p3zIEA/BLb4hL+kkLBp+/PWJfe2AKGA CjXgN40WTgLRqhz1X/uxhVmQIoIK4rzQxfOBuWHBR3OFZAbTrXupW/SkcSdH7/LRi2sG M6kNBEfukhgQUd8oXwInFY3mY6KvCNk7O2F+MaOTLL7ixEZ0OFG6ZvOluKwQ+UacRd9P OFeexjCez9/5zVMY6W6IVzhJNXC9O8qvlwqdvvMQOxNfkTBlwbw7RnLQHXPGRqWTRiyI Tm2Q== X-Forwarded-Encrypted: i=1; AKwUvByfhJVNbio88nSvS7ZKP+NRSVoxGJDY2XEjNHGA29dcyDKNQNsQvujmObGnpR2S/BBp2hSUYuqIRW60HXso@postgresql.org X-Gm-Message-State: AFuF++mUsq2Uu7W9DM+vxtPwHUUaxdA9DDtfZmRhLVn+BPH7apIrATcR Tb+xxS1lf+kmCodAmRDrxkfgu25fEZ637YDXC6bwCjCJbhxbaWIhEkMpIjiHaQ== X-Gm-Gg: AYBFou208swJ384U84IYZILjYutww1EoVeD5oxVVrzdoyFFlhahKDHohUUgNEWagSnT BiE2vKgYp69UltXHqTUEkKJ1+a4S2cvV3oZIY1kJfdxx2EUMMPMTe8wJTJf91Z6dhMBPD4f40EW KVQZBzB3ODUH3fpfbQL86EsMd0OOvsV8dYZzjlNujpIAF7pKE4/gyHsU8k9s33EUYF5NePUfYxp NX11aVJ5J2qxTaVBzpIuyHUbkjRQiTJgFOiFyyt2rz/HiEB9Gnx7GPoC59K5hQmVpxPxCnMX64Q OQJw/YxVJxR8ORLgXtmNm3c1L5/8PIwZSbZEMCz6eIRd1n4G5kZNWPyYbx2V0pKDbEg5OJ1FepW HBGsT59tqBoNh+zj86jB44yrGh+CQFfQT4T0aa8ERtdLksrGra9B8zV7IwEwMiPzKajLTHeqzqB 0rN+cEF6VRmDlfAf49tBmB1b5aHGkNA8FGJEVoP1i+jSpiAb4ywqiEyTofBVY5l+UHWx3VLTBa7 mE= X-Received: by 2002:a05:600c:4f89:b0:49c:e1df:79a4 with SMTP id 5b1f17b1804b1-49cf822c827mr187963665e9.5.1788763774157; Sun, 06 Sep 2026 23:49:34 -0700 (PDT) Received: from [100.64.0.1] ([165.225.27.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49ce58da3acsm792557765e9.0.2026.09.06.23.49.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Sep 2026 23:49:33 -0700 (PDT) Message-ID: <3b394e5f-ac4e-446c-b422-92be2b984722@gmail.com> Date: Mon, 7 Sep 2026 08:49:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add pg_stat_vfdcache view for VFD cache statistics To: Ayoub Kazar Cc: KAZAR Ayoub , Tomas Vondra , Jakub Wartak , Pg Hackers References: <42776281-3603-4161-b47d-d4ffd2029e8c@vondra.me> <02cfc5e7-e152-4d2d-8b4b-e899d9901ed5@gmail.com> <52677fc8-f57d-48c2-9415-6beb3ea6fa01@gmail.com> <11d0df16-94b8-4223-87f7-2e84084a28af@gmail.com> Content-Language: en-US From: David Geier In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >>> what GetMemoryChunkSpace() works on IIUC. >>> Am i correct here? >> That's interesting an interesting realization. You're right that we >> cannot use GetMemoryChunkSpace() in that case. >> >> However, I'm wondering if the better approach wouldn't be to change fd.c >> to use a long-lived memory context. Then all bookkeeping would happen >> automatically and the memory size could simply be reported via existing >> memory context stats infrastructure. >> >> Not entirely sure though if there's some roadblock when switching to a >> memory context. > I don't see any issue with this either. However, the only benefit we would > gain is using existing infrastructure but only for backend vfd cache memory > (i.e cache_bytes). > Everything else stays the same (counters, cluster-wide memory); therefore, > if there's no other benefit to replacing with memory contexts, maybe it's > not worth it. The biggest benefit in my view is consistency with the rest of PostgreSQL. That is from a usage point of view as well as from a coding point of view. If you want, I can give that a try and share a patch with you if successful. -- David Geier