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 1slCeC-005yXV-Fb for pgsql-general@arkaria.postgresql.org; Mon, 02 Sep 2024 19:23:33 +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 1slCe9-00179C-Mh for pgsql-general@arkaria.postgresql.org; Mon, 02 Sep 2024 19:23:29 +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 1slCe9-00171S-Av for pgsql-general@lists.postgresql.org; Mon, 02 Sep 2024 19:23:29 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1slCe7-000Kg9-2K for pgsql-general@lists.postgresql.org; Mon, 02 Sep 2024 19:23:28 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c26852aff1so857684a12.3 for ; Mon, 02 Sep 2024 12:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725305005; x=1725909805; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=S4q8oJ2SicBWcPwZpE8vlHs8zvkRspsa1XGT5v4k94Y=; b=AR+K1wUWB8a2/u5ZvJeZ+cuXP5QoJCViNXPCahFNfQIUzUwVMF0dA61CwVuNiYL4E8 oxKw8+1mjTXaIsq3lmB8eU4kQLeqzk/usRO9QfIyMKOmCLxQynlF7thsTwi1YdZ1VSAX TqnhF8ZNAOj1t+7WCSSwXMTitXyGetZVm7yCsm8wCOBi9yhmDlyG/iDuPX8tEuM+c4lx cgX1SaOnfrSe2jbBWG0URXjGLkYBebR1bu7BhZB1zpB84iOMFY/iS2Agbru54rQImqeO RFs3AzNXXbJYMeDi9qMj+XW0UdePDhsBXF6NZenkR+ng6ICTG3VpSdffWD+2wQHGzwbj AzsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725305005; x=1725909805; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S4q8oJ2SicBWcPwZpE8vlHs8zvkRspsa1XGT5v4k94Y=; b=bdBcwQVCAZhRgegusqRZyKCFq2nCZDxRo1wpweCKJAmz51JEpBZwdFiySlP+pWn35R SGD2hM6+7SNtx+uf2FraYJWqgbhPr3Cl8F/pgD96k9XwHKxN8v2ZQEdjyf5qpb1J55b4 J8Cwd62EV1z0mSnd576K2Ref5umANaceQn5C8sNNW9pb4bIFKHnxzcnUHup5R/yJbgTH mtEDEcSlBzeYP269WQVrpsmjsC2rGbTzHql+MSPglsFZmE4InS4jWgjPx85HUrdQDDW5 zHY1cgZoRnR0cRitFhJNulFcOy1YYSbaOtUTvgOsfa6fr1ztoJLDfwNKLk1EiB152yL8 27+w== X-Forwarded-Encrypted: i=1; AJvYcCU4PUYCM9XG2o2yAH5QHhOuT6aqZgfJs8obhnJiDCwC3CuHTEtmla7HOquBhC1oWp9/DIdvMgHTVqT4Oe5N@lists.postgresql.org X-Gm-Message-State: AOJu0Yxux3gM1j56vdLnhGZBxla9LTgFtLZg//wDYW7mDmwtjJK4BbmB LYW/I53dZNuOCfqNtJ4NUwuGoDLd1wTD1nZmNLG1+21ZSzumhyKj8w5/jqw0DuMxoX7OXN6DE2j zOyh+AbgW9sG9XXtS0wjlPjLFwoA= X-Google-Smtp-Source: AGHT+IGWPRhbp04yMtb8giCDd9+flgOsNHcYnnITwVvnli7HohYgSfxH9bwEyShGleRxF4lbgLMIlbsjRWIuDL2G3/I= X-Received: by 2002:a05:6402:4402:b0:5c2:4d9f:60c with SMTP id 4fb4d7f45d1cf-5c24d9f0711mr4084931a12.7.1725305004728; Mon, 02 Sep 2024 12:23:24 -0700 (PDT) MIME-Version: 1.0 References: <3bda0d10-0d60-42b7-9600-abe23d54bb16@postgrespro.ru> In-Reply-To: From: Melanie Plageman Date: Mon, 2 Sep 2024 15:23:13 -0400 Message-ID: Subject: Re: PG17 optimizations to vacuum To: Peter Geoghegan Cc: Pavel Luzanov , "pgsql-generallists.postgresql.org" , Heikki Linnakangas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Sep 2, 2024 at 1:47=E2=80=AFPM Peter Geoghegan wrote: > > On Mon, Sep 2, 2024 at 1:29=E2=80=AFPM Melanie Plageman > wrote: > > I'll investigate more tomorrow, but based on my initial investigation, > > there appears to be some interaction related to how much of the > > relation is in shared buffers after creating the table and updating > > it. If you set shared_buffers sufficiently high and prewarm the table > > after the update, master has fewer WAL records reported by vacuum > > verbose. > > Fewer of what specific kind of WAL record? I would have expected to see no freeze records (since they no longer exist) and the same number of prune records. However, the overall number of records that I get for 16 and master is pretty similar. For some reason I stopped being able to reproduce Pavel's case. I'll work more on it tomorrow. This is roughly what I get for records by vacuum. Note that I prefixed VACUUM with BTREE on master to indicate those records are from index vacuuming. By default the headesc routine for records emitted by index vacuuming prints just VACUUM -- perhaps it would be better to prefix it. Note that these add up to almost the same thing. I don't know yet why the number PRUNE_VACUUM_SCAN is different than PRUNE on 16. PRUNE_VACUUM_SCAN and PRUNE + FREEZE_PAGE on 16 are similar. So, there must be pages that don't have items being pruned which are being frozen. I'll need to investigate further. master -- PRUNE_ON_ACCESS | 6 PRUNE_VACUUM_SCAN | 30974 PRUNE_VACUUM_CLEANUP | 14162 BTREE_VACUUM | 19127 16 -- PRUNE | 15504 FREEZE_PAGE | 13257 VACUUM | 34527 - Melanie