Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXQE1-0002QW-UP for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 17:26:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXQE0-00032B-Q2 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 17:26:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXQE0-000322-FB for pgsql-hackers@lists.postgresql.org; Wed, 01 Mar 2023 17:26:44 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pXQDw-0007NQ-Om for pgsql-hackers@postgresql.org; Wed, 01 Mar 2023 17:26:43 +0000 Received: by mail-pj1-x102a.google.com with SMTP id cp7-20020a17090afb8700b0023756229427so18130407pjb.1 for ; Wed, 01 Mar 2023 09:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=MvvFv41AyHAlCewihT+qzy7zscUs73nAp3wlQr841xI=; b=pC++427Jda+eqPF5SED6GKVnAQMLHsA0xkB7VkTywJeeQ6PN+DPNJqBF2qeeU0Tvgm BpNJ6esSmzQNollQr0W+0XruwQ2o2nRkRoecac5kkq9fOf4R4fUFc91yurOKJRE7A3Ti vsds/dll+CGApHTOro6H78lddE+iStKhNOndweG5a+mAlpmWdyJqcqMQLLMzpucOXCiC uOex+hjVSLs9i8OG8ZhZXZQAd6po8M51Iw4IiEdIEz6/vpL20mga1L/ZyDRgSJCZk3sE pvimO+Lnqspe3TAjbmm8VHsSFb2o6VUdD02l2GE9m4S+qxwCZ2dQ6/OlR8MiNZ+WLF3S xrCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=MvvFv41AyHAlCewihT+qzy7zscUs73nAp3wlQr841xI=; b=CRg3/RHinuOsromvybbZ8Y5bganOPUVQAj3c3eDpJSXegNftB320BO8+9aqO/vH9Gh wjnPgWQQMOwYzotXekKCNiSUb332Tkux8WHPIFKo6HFWciNLSHyQog4QIeIsrJeTCi6Y m2J9p/lfrkhOHARQn2ef5zJVuRnBW8kPg22LbpxLwkPxHpcKaQiCw9SNh1ckKlZJSbYM g3ovMAGVkYMGurm+jIkL276XkcnuYbF2uuTz/CosEfnF+RkmCQeF6UMX2UOi3lVV52I7 ld5neM+wpPLhGLqnFPBBElXoumlnYYswhQXBoVEBdHa8nz5UlgDaNF6kwCV+/osSZtnw Po3w== X-Gm-Message-State: AO0yUKXosjoYMiImuYY/D8adyWZ9qlpQH4WkFQnKl0uaS4I+So5DmyAr 4SZkLKPpkIlHTQs1vVdiJf4= X-Google-Smtp-Source: AK7set++H9Kyzz2V/b98/m3/WnHOkSf/CdrKHw4HmBipFfY3eFMZMG60uXnYwq6xbPdshowfbaQFAg== X-Received: by 2002:a17:903:2308:b0:19d:16ed:3e34 with SMTP id d8-20020a170903230800b0019d16ed3e34mr9098346plh.26.1677691599812; Wed, 01 Mar 2023 09:26:39 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id i5-20020a170902eb4500b00198fc0a191bsm8776711pli.160.2023.03.01.09.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 09:26:39 -0800 (PST) Date: Wed, 1 Mar 2023 09:26:37 -0800 From: Nathan Bossart To: Michael Paquier Cc: vignesh C , pgsql-hackers@postgresql.org Subject: Re: add PROCESS_MAIN to VACUUM Message-ID: <20230301172637.GA1456203@nathanxps13> References: <20221230000028.GA435655@nathanxps13> <20230107050724.GA914213@nathanxps13> <20230119190807.GA4062411@nathanxps13> 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 Thanks for taking a look. On Wed, Mar 01, 2023 at 03:31:48PM +0900, Michael Paquier wrote: > PROCESS_TOAST has that: > /* sanity check for PROCESS_TOAST */ > if ((params->options & VACOPT_FULL) != 0 && > (params->options & VACOPT_PROCESS_TOAST) == 0) > ereport(ERROR, > (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > errmsg("PROCESS_TOAST required with VACUUM FULL"))); > [...] > - if (params->options & VACOPT_FULL) > + if (params->options & VACOPT_FULL && > + params->options & VACOPT_PROCESS_MAIN) > { > > Shouldn't we apply the same rule for PROCESS_MAIN? One of the > regression tests added means that FULL takes priority over > PROCESS_MAIN=FALSE, which is a bit confusing IMO. I don't think so. We disallow FULL without PROCESS_TOAST because there presently isn't a way to VACUUM FULL the main relation without rebuilding its TOAST table. However, FULL without PROCESS_MAIN can be used to run VACUUM FULL on only the TOAST table. > @@ -190,6 +190,7 @@ typedef struct VacAttrStats > #define VACOPT_DISABLE_PAGE_SKIPPING 0x80 /* don't skip any pages */ > #define VACOPT_SKIP_DATABASE_STATS 0x100 /* skip vac_update_datfrozenxid() */ > #define VACOPT_ONLY_DATABASE_STATS 0x200 /* only vac_update_datfrozenxid() */ > +#define VACOPT_PROCESS_MAIN 0x400 /* process main relation */ > > Perhaps the options had better be reorganized so as PROCESS_MAIN is > just before PROCESS_TOAST? Sure. > +-- PROCESS_MAIN option > +VACUUM (PROCESS_MAIN FALSE) vactst; > +VACUUM (PROCESS_MAIN FALSE, PROCESS_TOAST FALSE) vactst; > +VACUUM (PROCESS_MAIN FALSE, FULL) vactst; > > Thinking a bit here. This set of tests does not make sure that the > main relation and/or the toast relation have been actually processed. > pg_stat_user_tables does not track what's happening on the toast > relations. So... What about adding some tests in 100_vacuumdb.pl > that rely on vacuumdb --verbose and check the logs produced? We > should make sure that the toast or the main relation are processed, > by tracking, for example, logs like vacuuming "schema.table". When > FULL is involved, we may want to track the changes on relfilenodes > depending on what's wanted. That seems like a good idea. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com