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 1w52Re-002piT-1q for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 14:09:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w52Rc-0071ao-2a for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 14:09:21 +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 1w52Rc-0071af-1e for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 14:09:20 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w52Ra-00000000t7a-1kIu for pgsql-hackers@postgresql.org; Tue, 24 Mar 2026 14:09:20 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-43b44c0bcdbso5840170f8f.1 for ; Tue, 24 Mar 2026 07:09:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774361357; x=1774966157; darn=postgresql.org; h=content-transfer-encoding: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; bh=f/2MxSQHAutBfObWLugNP5JJU32l1q+N3zutD2cxWAs=; b=OVHWh5iOwuwVpJA4e7YwBi7R74VD76reBFQVTYYxPhcmghpD28vTXnjmyNXNlonKmq DlfefUhyMXsLuBHQr95+C06QOuKeXpKQfAHYnaPYsndIPSLLMnSwq70KNhMag+EjlLua v1yIJw+uDl0AmogbsHYEWfqhmgSGMCTOcnEpHu6n/PZl5eMJoMB2Ubpl4fiiRRGKu3vw J48EM4BwqUBFxkvpSq+FdQtHyAOH+ewofH9ZSxQpyuDmCZfLSBulk+hqs4zDcvsrXH6R nT6/t/ZzWzmeGPK3KV2qmtghH3cEXkwuh0zlT4fhND/WkpoL/aTvAjqaaN+XX23wT/1F vbEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774361357; x=1774966157; h=content-transfer-encoding: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; bh=f/2MxSQHAutBfObWLugNP5JJU32l1q+N3zutD2cxWAs=; b=Mwr05D0G3nU0Cg/o9q/gCB1BUr6ZS/suALhV3CCU4L0ykCu31e/kEpU1bJgQKnM8rm Z39r8fc8CwRXVJp3SZC2LbfFA2JPJKSQuTdjifrFalsgaKXq0m8JxSNG/utW2Zc/YQPw smGLaUaX0JcRZkHT7osal80jkawnFRUKaDahZSHktIqsC/njFgKO2/hoKjrHEkGMEgkS f5hLJ4in+lj6zcTII1rhuC52fX1R3aZvu+f5ma/IPoBQVd7O1vdhsuxX5jHQ+h9Dr6Gu xAz0v9/7Vt9RvtS1QlyuzhuC194iSGHahh1+PATOjWrGxWI36sm7VJK2aYVWScFQS9oT gRkg== X-Forwarded-Encrypted: i=1; AJvYcCWY8tJiHp0V3Ytjbw8IeLMdhsXPeltD672wLjlUf66MebJNZlzLko+93i6lSr7jFrAdmjSReW15mcvStQ6Z@postgresql.org X-Gm-Message-State: AOJu0Yxf8qbnRO8fpQB+LwsEXxmKXmDUfMdmnUPfJzVmi7XhFVvo+jGI +/qNyYdvRyxDRrj7TkaUNDqYLxIQWhcdU/Q/c0hG6geSei6Ojma8LuQC X-Gm-Gg: ATEYQzxhi4H5Y9r6fcI4P6JSgrZaCDMFzh9PHCruT+BAFfXh6cWgc5ku13nb4ZsV+Pd eYUC4FE1rurOCGLiUexcAOtEcGJ6JI1tssaiL/0n5PnNdDk/Pt6Y+dGyMZlME60DmdWp0t1kRMx 9p48LaApeNRdgAs2/yvQcFQGRg31AZXH5ZfjYtm9OBRrss+fks0fzEEqvt2K8h4S3GXbXhAFYYO 8hsN3NYjCHeRFx0U1wh3H35P6wlsbcTkygS7XgUD7G4Y3ddTwWi3ob9vB7faNQ9Krs/TgW6FV+/ 74cACxw5b6aha2UfkTb7aOErX+ZR+bNxv8ScXZiEVP6O1fzYGKtuDcxsg+Uc8+oYz9Wk8gP8siN Xbe66eUK3u/lHKQ/ALbMUOYjuYn2e/XUCEwGSEk9lE57Ck2TLU9/ZHbP7Ij85KQ8QSpU+pQDkUQ F1AT8Zcg13rg/+IGuMjjsh4I8QjQ== X-Received: by 2002:a05:6000:2508:b0:439:c1b7:890d with SMTP id ffacd0b85a97d-43b64262ed1mr25561963f8f.26.1774361357404; Tue, 24 Mar 2026 07:09:17 -0700 (PDT) Received: from [172.31.5.233] ([147.161.235.32]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b85082842sm3582936f8f.20.2026.03.24.07.09.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Mar 2026 07:09:16 -0700 (PDT) Message-ID: Date: Tue, 24 Mar 2026 15:09:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add pg_stat_vfdcache view for VFD cache statistics To: KAZAR Ayoub Cc: Jakub Wartak , Pg Hackers , "tomas@vondra.me" References: Content-Language: en-US From: David Geier In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.03.2026 00:36, KAZAR Ayoub wrote: >> I've looked at struct vfd and some simple changes to the struct would >> already cut memory consumption in half. I can look into that. >> >> Thoughts? > > Looking forward to this. I try to come up with something the next days. > What also bothers me in that space is if a backend allocates 100K entries > in VFD cache, that cache is never shrank ever again, > the cache only grows (if it needs more than its lifetime maximum) until the > backend dies, although this is useful as entries are reused if free instead > of > allocating entries, whether a spike in files openings effects a long living > backend to keep holding a useless amount of > cache size it will need in the future, i don't imagine this to be common > though, what do you think about this issue from your experience ? Currently the cache is directly mapped by the VFD index. That means we could only resize down to the maximum used VFD index. Being able to resize independently of the maximum VFD index would require changing to a hash map like simplehash.h. I can take a look how invasive such a change would be. -- David Geier