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 1uShAX-00BpsE-Ct for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 19:12:57 +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 1uShAV-003oDA-3X for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Jun 2025 19:12:55 +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.94.2) (envelope-from ) id 1uShAU-003oD1-Pu for pgsql-hackers@lists.postgresql.org; Fri, 20 Jun 2025 19:12:55 +0000 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uShAM-0036Vt-19 for pgsql-hackers@postgresql.org; Fri, 20 Jun 2025 19:12:54 +0000 Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-3de18fdeab0so23774755ab.3 for ; Fri, 20 Jun 2025 12:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750446765; x=1751051565; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lTSyZ/fi59GJU08rRv+lkLvuhTOcrWnJ5aRuyz7/Lz0=; b=CBMQxFjUFb9itRETPdNj4XGukf6Sm19bqWXxwEx4xV0AiZ6Oy8EMW1n+xNe0aLogav jrTUf6t33S96dCg192EMM2IF0ZcauUBDkNxsyKPkmzgn5OFwhp+wIyuCjzFjBDEPcKB8 q39nh/BU17XmNePeYr2Ea5W7KFPxAPKHjEd9vOUAMmY4qPTNV8xd8Kvg0QzqLUwpbEto OabPQWGCFGRHmDAQ4R36z0LQG3suoaJKQHNfIL1CyNdxmYmEWRHWjNpPoRuZkt4O1URH EJQINDoPqvyBhaqK0sHjc6lYGvZO0WqMF3h7ssh+7gMMGz5/DDc0/QPzq7NQSmNNFlWi ZnPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750446765; x=1751051565; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lTSyZ/fi59GJU08rRv+lkLvuhTOcrWnJ5aRuyz7/Lz0=; b=fSvQtL4VaGPKgDp6ZeddOCrDVHR8iYcIxkVFxq6ObKjTxvHeQVbv5+MW/bfo1YHEo/ af+h2kNoQBsLrzI41bprpwtm/GDzuVLOh+pYg71DQ2kl7NTERRVuW27GA+aL2dWeg7O1 isLXpCBVo8c3+OTaeZCmrx9kTEl5uUoWFoy4DxPGaB8ezzS+0YlBOcd8Ci1R0nMT8bQ+ udgfkI2SGF9gECS7tuZ2j6AGq1JVNKM31t+RurPZ570H2/GsP+gUzkBmF7RMHISH0oBF TdnqdZTjIdVxgoB25DaLegq6a8mz2Jh62hws0BN3PbjUxzK6oP5aBjvxQKtgwqiTJoMt jIdg== X-Gm-Message-State: AOJu0Yz2JTGb3qdjpTj8cTRCZY/B3H3XKPi7G/wM669VziwDNlx7h9FA I70Be7/pgRE1MiOa1iroQ9zstAQ6eGG1MVVu6UKZ9S4YvHmwfX3Gt655o14i4g== X-Gm-Gg: ASbGncu/cTUznlIb4W3eufdoF4B1w74aJYN8QlSpiyrg/+SSeC/Htn0ISUVHevyEuWC /GsaqZEEdHq3iB0ritypC4RWR+vP9/M8UPAV8aNYeNITn2T403LrWNTc74yXRxtlb/Xdy3Oszpd Syl0+W7JHswAiDAu0n+GRM8olhoLjX68HNbIC6wTCmItxYthqwK9jKYuw7JXCWpKMLM2pwzvIyz hPIjYnA89YGvqI3yeIgc6OzjxjtQYpfjgVzUL/RIdX2iTg48aEuQIUuGolQQKBnNOjnQYrX0sxI rEPHx3apGg4AP7xOuQpeb4QnASKCdSbi/ZaduzI8V9aPjxpZGeb8+DZ4GrqjweMZ+65o03lYLW4 D+xKgSs2hkdBsgh2Wf0WrsfCZQik7WqigSyzoaKJ+J2mgKUhJWEfT X-Google-Smtp-Source: AGHT+IF0RMT4sB0OLXgGBiY8FY+9wf/VBppw5lYoN267g2EAT28tYmgYyOCsGQus/7S/kRcIlnf7zA== X-Received: by 2002:a05:6e02:3c03:b0:3dd:b808:be68 with SMTP id e9e14a558f8ab-3de38cbfe51mr47258145ab.16.1750446765455; Fri, 20 Jun 2025 12:12:45 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3de3772e133sm8271785ab.35.2025.06.20.12.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jun 2025 12:12:44 -0700 (PDT) Date: Fri, 20 Jun 2025 14:12:43 -0500 From: Nathan Bossart To: Michael Paquier Cc: pgsql-hackers@postgresql.org Subject: Re: problems with toast.* reloptions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jun 20, 2025 at 11:05:37AM +0900, Michael Paquier wrote: > On Thu, Jun 19, 2025 at 03:20:27PM -0500, Nathan Bossart wrote: >> * vacuum_rel() does not look up the main relation's reloptions when >> processing a TOAST table, which is a problem for manual VACUUMs. The >> aforementioned bug [0] causes you to sometimes get the expected behavior >> (because the parameters are overridden before recursing to TOAST), but >> fixing that bug makes that accidental behavior go away. > > Are you referring to the case of a VACUUM pg_toast.pg_toast_NNN? I'm > not sure that we really need to care about looking up at the parent > relation in this case. It sounds to me that the intention of this > paragraph is for the case where the TOAST table is treated as a > secondary table, not when the TOAST table is directly vacuumed. > Perhaps the wording of the docs should be improved that this does not > happen if vacuuming directly a TOAST table. Yeah, I was mainly thinking of a VACUUM command that recurses to the TOAST table. Of course, it'd be nice to fix VACUUM pg_toast.pg_toast_NNN, too, but I'm personally not too worried about that use-case. >> This doesn't fix VACUUM against a TOAST table directly (e.g., VACUUM >> pg_toast.pg_toast_5432), but that might not be too important because >> (PROCESS_TOAST TRUE) is the main supported way to vacuum a TOAST table. If >> we did want to fix that, though, I think we'd have to teach vacuum_rel() or >> the relcache to look up the reloptions for the main relation. > > This one does not sound that important to me for the case of manual > VACUUM case directly done on a TOAST table. If you do that, the code > kind of assumes that a TOAST table is actually a "main" relation that > has no TOAST table. That should keep the code simpler, because we > would not need to look at what the parent relation holds when deciding > which options to use in ExecVacuum(). The autovacuum case is > different, as TOAST relations are worked on as their own items rather > than being secondary relations of the main tables. +1 -- nathan