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 1pifTs-0006WM-QU for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Apr 2023 17:57:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pifTq-0005l9-Iv for pgsql-hackers@arkaria.postgresql.org; Sat, 01 Apr 2023 17:57:34 +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 1pifTq-0005ky-5L for pgsql-hackers@lists.postgresql.org; Sat, 01 Apr 2023 17:57:34 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pifTi-0006OW-Is for pgsql-hackers@postgresql.org; Sat, 01 Apr 2023 17:57:32 +0000 Received: by mail-il1-x12c.google.com with SMTP id n11so118383ilj.9 for ; Sat, 01 Apr 2023 10:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; t=1680371845; 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=5ZgEwkB9HittxCSzvrjEbkNV0MiFvO4BwlFkoNEnbAk=; b=euySB4hVkssl7TDZKPnHThFFSyzkB+j6bO8sSpk1jXEaMm7MYiNnZza4rKshpmMN/X fMlWpsU2FDUrDW9ocNx37yGTsey5A+ILZ4nuEJuOkIdFNiuuJLx8PzXDSsops1ooOwqz 4R/xbRtZkbqjWsfd6mqkmQizIMvZO+lACvyG4+qTbW4zragEpkrVGfqD++AaLXSjb471 M81WTaSmEDOEVCDIRwGf/iPzkXTC6Z25XBh5azXbrlJkKczY0Y66XugAnoy363jVizFu EDLEMjOZ2uUQn4eFQqboLrUTmF27+tGtGNsYrdde6I7WILb39ET+lN40YQ6UyGE8vkYq AhKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680371845; 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=5ZgEwkB9HittxCSzvrjEbkNV0MiFvO4BwlFkoNEnbAk=; b=XDWnQqOAJB2RQyu527Xmlx9pc45z+tFGR3sG3fgHd7gCRVSJvCcRA29POpoec3Eeeq 6H8E4ZNZNHy++l3S/IPldjrnZiVg51DU2t+ZlaLRiFYEwQfwzz6C0AlApsPdDodd3Y9/ JHw1qNXOP0/OWuGMig+QrJ74M8p3+z0cbGNJjAlhTjt7+8OHKS6m1MXWYf/PwixLHUY6 XGTpmrTVyBDqzYd15DN9sPlJQdzZqlxLxvpez08OnnU7B/qvlWvRAvsKsugilprDxELm SG6HOYWBDVHMzls1cBsNau92+0FrAJhpIxk7g04t6QJhanzlLrnY5sJ96P4aWFb3pZoJ lEgw== X-Gm-Message-State: AAQBX9c1Hqxu7YUhbtz++KhM5LfR6hcLggdDxQbfDr7bf/XDg//Ojq7R meci1KGm367NMdZXd2fucZJdnA== X-Google-Smtp-Source: AKy350b3YpjOtil+ZxFmZdaaFBYvdK1JlQT8Ysf033qx1K6U0HU1gVOAO3ErQJq6mhCq9BNsnoeLyw== X-Received: by 2002:a92:dac4:0:b0:318:ab40:4e9b with SMTP id o4-20020a92dac4000000b00318ab404e9bmr21170082ilq.2.1680371845515; Sat, 01 Apr 2023 10:57:25 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id s22-20020a02b156000000b004063842e6aasm1510095jah.46.2023.04.01.10.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 10:57:25 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id DBF5A800370; Sat, 1 Apr 2023 12:57:23 -0500 (CDT) Date: Sat, 1 Apr 2023 12:57:23 -0500 From: Justin Pryzby To: Melanie Plageman Cc: David Rowley , Masahiko Sawada , Bharath Rupireddy , Andres Freund , Tom Lane , Peter Geoghegan , pgsql-hackers@postgresql.org, Robert Haas Subject: Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode 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 Sat, Apr 01, 2023 at 01:29:13PM -0400, Melanie Plageman wrote: > Hi, > > I was just doing some cleanup on the main patch in this set and realized > that it was missing a few things. One of which is forbidding the > BUFFER_USAGE_LIMIT with VACUUM FULL since VACUUM FULL does not use a > BAS_VACUUM strategy. > > VACUUM FULL technically uses a bulkread buffer access strategy for > reading the original relation if its number of blocks is > number of > shared buffers / 4 (see initscan()). The new rel writing is done using > smgrextend/write directly and doesn't go through shared buffers. I > think it is a stretch to try and use the size passed in to VACUUM by > BUFFER_USAGE_LIMIT for the bulkread strategy ring. When you say that it's a stretch, do you mean that it'd be a pain to add arguments to handful of functions to pass down the setting ? Or that it's unclear if doing so would be the desirable/needed/intended/expected behavior ? I think if VACUUM FULL were going to allow a configurable strategy size, then so should CLUSTER. But it seems fine if they don't. I wonder if maybe strategy should be configurable in some more generic way, like a GUC. At one point I had a patch to allow INSERT to use strategy buffers (not just INSERT SELECT). And that's still pretty desirable. Also COPY. I've seen load spikes caused by pg_dumping tables which are just below 25% of shared_buffers. Which is exacerbated because pg_dump deliberately orders tables by size, so those tables are dumped one after another, each causing eviction of ~20% of shared buffers. And exacerbated some more because TOAST don't seem to use a ring buffer in that case. > I somehow feel like VACUUM (FULL, BUFFER_USAGE_LIMIT 'x') should error > out instead of silently not using the buffer usage limit, though. > > I am looking for others' opinions. Sorry, no opinion here :) One thing is that it's fine to take something that previously throw an error and change it to not throw an error anymore. But it's undesirable to do the opposite. For that reason, there's may be a tendency to add errors for cases like this. -- Justin