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 1pAy0t-0000SM-U4 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Dec 2022 18:52:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pAy0s-0000Nn-ND for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Dec 2022 18:52:22 +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 1pAy0s-0000KK-Bu for pgsql-hackers@lists.postgresql.org; Thu, 29 Dec 2022 18:52:22 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pAy0p-0005fT-EM for pgsql-hackers@lists.postgresql.org; Thu, 29 Dec 2022 18:52:21 +0000 Received: by mail-pj1-x1034.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so23720971pjj.2 for ; Thu, 29 Dec 2022 10:52:18 -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=7CjYI/i8zL8prMC06fJkIKpRfHyes/DD6BLRwusrgu8=; b=q51itkN+E8n41qI7tE4+d5LfylBLHnRFjfdYrIWH0483x+Kl75V2QuPGuoYorA4VPy VOzgMtMvZGLSBlQEnafBtqlo05p9sYQePq7TJQmXjyoRkBjUb4kCNqvtPZLHKHjLDaiF IMn+xJciMmseZYWcfSMv99v9tPZ/Hzw14tCR0SMPJqurXbMuYPaIKd4DZ9c/2gjatVvi /L4vf5VKSAA2/POIPEkrohT5FqDtXeUpAPPq+o0AOCw+mIqF3qrXR62CXLmMsSMa7Vvq zSxscmJrO02DNqOr4B5pqXacpGl3/Osr/6VeneKKcR5YYcOTlBCY6RYPFOhzDnQOV+pC n7rw== 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=7CjYI/i8zL8prMC06fJkIKpRfHyes/DD6BLRwusrgu8=; b=yCRmL+U0E5/MCxn2BWjre4h1yV49Sj2kjpFHO9jd8vRWO6q/3UBIdKTTgeVNZt8gRy PGc2mavaAacb39m7Y+Cy4GmNYyl66r1h8VqjXEWXHYYWXqb66NtQ/eW6aUwdyUA5cKWS DUuPzs3RjDvpJTvWcEjSXh2QniFDSBQR7sXtSYtIB7xwXL1PK+mJvZBIXTGfEUlhUiW/ GaMdYxtHm4ij/2PHFB6llmN7mlggdQ4uqzGckFG9yDZPA22cJz7DiiXMFqf857PUbl5v JH7QrXi6U607YQdPx2kbrH+8GGfb1pzXlphEsFDVfS9bBpWCOLIR/MEVoQJeOKKqTBcN aK7A== X-Gm-Message-State: AFqh2koXboDV3ypFVpnZOkJoUCd21Jaqu9KTItTFFtlm+99SPC/G6LRJ n7t87mvQEnCSmN7ymbSo3SU= X-Google-Smtp-Source: AMrXdXtzTRAbAXDHMP1c2GQOomxhT7AKOYdaADCZdd5ET4CTpJ+seY+5WbsBQEdWCWyGXQ3/VYylwA== X-Received: by 2002:a17:90b:485:b0:20d:bd5e:d54a with SMTP id bh5-20020a17090b048500b0020dbd5ed54amr31886748pjb.21.1672339937031; Thu, 29 Dec 2022 10:52:17 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id f8-20020a655908000000b0047829d1b8eesm11478015pgu.31.2022.12.29.10.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 10:52:16 -0800 (PST) Date: Thu, 29 Dec 2022 10:52:14 -0800 From: Nathan Bossart To: Andres Freund Cc: Tom Lane , Peter Geoghegan , postgresql@taljaren.se, pgsql-hackers@lists.postgresql.org, Michael Paquier Subject: Re: BUG #17717: Regression in vacuumdb (15 is slower than 10/11 and possible memory issue) Message-ID: <20221229185214.GA212944@nathanxps13> References: <17717-6c50eb1c7d23a886@postgresql.org> <3439037.1671130590@sss.pgh.pa.us> <3544447.1671141436@sss.pgh.pa.us> <3672943.1671202149@sss.pgh.pa.us> <407579.1672258403@sss.pgh.pa.us> <20221229030329.fbpiitatmowzza6c@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221229030329.fbpiitatmowzza6c@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 28, 2022 at 07:03:29PM -0800, Andres Freund wrote: > Separately I wonder if it's worth micro-optimizing vac_update_datfrozenxid() a > bit. I e.g. see a noticable speedup bypassing systable_getnext() and using > heap_getnext(). It's really too bad that we want to check for "in the future" > xids, otherwise we could use a ScanKey to filter at a lower level. Another thing I'm exploring is looking up the datfrozenxid/datminmxid before starting the pg_class scan so that the scan can be stopped early if it sees that we cannot possibly advance the values. The overwrite-corrupt-values logic might make this a little more complicated, but I think it'd be sufficient to force the pg_class scan to complete if we ever see a value "in the future." Overwriting the corrupt value might be delayed, but it would eventually happen once the table ages advance. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com