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 1m5Od3-0002VH-Eq for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jul 2021 08:27:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m5Od2-0002dZ-8x for pgsql-hackers@arkaria.postgresql.org; Mon, 19 Jul 2021 08:27:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m5Od1-0002dR-W0 for pgsql-hackers@lists.postgresql.org; Mon, 19 Jul 2021 08:27:56 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m5Ocu-0005g2-PP for pgsql-hackers@lists.postgresql.org; Mon, 19 Jul 2021 08:27:55 +0000 Received: by mail-pf1-x434.google.com with SMTP id u126so8099908pfb.8 for ; Mon, 19 Jul 2021 01:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a0RBmArb2ilWN5534VgVRM8zd1YPeIr9ZLD4Aref8SY=; b=Cw0oCEgRtikGfJ6LO80/ChkUpf+d5tbUU8z35HpmHRJ2bmSknuta1E/NXEMrI2nNa7 Zc+jdQaTd6qR/w7ebA2Qq010+e6wR6FANfsUG41ZHDN1mxuyzSTakLG6avktygjVWxIn YLoXBRqfQf2D+L8zQMGeArI5CAtAALRhhsds0/wrDtTBfmzDcGmw7woRDXUIYoj9vcMt s81xZMcOF9bWNzLGREEemhWBO9S2z3gEcusU2YINpz/em2TP6eGcMZXj7DG8tQpfTL7I m0/wAUUC/CG6n1tDBDjoZnAtXHMRgkIDuj7zl5BpA7ReS6Y8PuKx8PwVgCQs60eAwRLI Pa3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a0RBmArb2ilWN5534VgVRM8zd1YPeIr9ZLD4Aref8SY=; b=ifYL0JJmNGZ9C3IAsWSOAQGLMtnFwQ+bjSscUu3bCJuu0Rv4aJc/XNEDFtOPiQ/60y A4OUwNOW0uSAvVGaynTUknhD0eN6YJw+qJ4Exr7HcMCAcuZ9T0z35pQAn+zIMT19Bu/T f69RT8KkVBvTJidddLxD3UXYHs0hv6EUv4UtcJyKFU0RAw6SpQ396TettHXnB4xUpM5C S3ewh/2joUwd5YvPqwi3qybVnioJ0m1Hf1DJ338HaCecrCvqIrfLjr+NENciGz4u9aOF EX6KlBnL236hrIFI7HcJ92WfbVAXQT7Y0KgWMseaePQYyLrP0vUcn3qnfQ3H0XoI+UO6 d91w== X-Gm-Message-State: AOAM530J56if838mbdluB7/Mitwiu78EpMzRi8puh1muShwnofAOzAUB 1Ufb1TqPzuhs9d7cRyYIKDyHmsdAjwFnuRi+rLM= X-Google-Smtp-Source: ABdhPJwJL8eXRvbKzI4geXT6+sZgefSv9hxzpJ/eXEjPfx6Pb46td/JzVJvdtCwbbGavMwCYCxzTC/5F6FhQioJ3Ats= X-Received: by 2002:a05:6a00:ac8:b029:320:a6bb:880d with SMTP id c8-20020a056a000ac8b0290320a6bb880dmr24892724pfl.41.1626683266562; Mon, 19 Jul 2021 01:27:46 -0700 (PDT) MIME-Version: 1.0 References: <1c6fa18692a77ff6098dedc0c150df24ffe9db89.camel@cybertec.at> In-Reply-To: From: Masahiko Sawada Date: Mon, 19 Jul 2021 17:27:10 +0900 Message-ID: Subject: Re: Update maintenance_work_mem/autovacuum_work_mem to reflect the 1GB limitation with VACUUM To: David Rowley Cc: Laurenz Albe , =?UTF-8?B?TWFydMOtbiBNYXJxdcOpcw==?= , PostgreSQL Developers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jul 7, 2021 at 8:44 PM David Rowley wrote: > > On Sun, 4 Jul 2021 at 22:38, David Rowley wrote: > > I could do with a 2nd opinion about if we should just adjust the > > maximum value for the autovacuum_work_mem GUC to 1GB in master. > > > > I'm also not sure if since we'd not backpatch the GUC max value > > adjustment if we need to document the upper limit in the manual. > > I was just looking at this again and I see that GIN indexes are able > to use more than 1GB of memory during VACUUM. I think you meant that autovacuums can use more than 1GB of memory during cleaning up a gin pending list (in ginInsertCleanup()). The description updated by that commit is not true as of now as you pointed out but IIUC it uses maintenance_work_mem *in addition to* the same amount memory used by lazy vacuum. This memory usage seems rather weird to me. Is it worh considering having gin pending list cleanup use work_mem instead of maintenance_work_mem also in autovacuum cases like btree indexes do? If we do that, the description will become true, although we might need to update work_mem section somewhat. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/