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 1ucckn-00F2LH-Bv for pgsql-admin@arkaria.postgresql.org; Fri, 18 Jul 2025 04:31:25 +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 1ucckl-007XFV-Bs for pgsql-admin@arkaria.postgresql.org; Fri, 18 Jul 2025 04:31:23 +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 1ucckk-007XF8-Ui for pgsql-admin@lists.postgresql.org; Fri, 18 Jul 2025 04:31:23 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ucckj-007sUS-1Z for pgsql-admin@postgresql.org; Fri, 18 Jul 2025 04:31:22 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ae401ebcbc4so278326866b.1 for ; Thu, 17 Jul 2025 21:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1752813080; x=1753417880; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=KmVBlDYxDEXFwgW2S7JoN0otMjgoZ/G5ohJLcLsXyeY=; b=Eps83buMtPPH5YKLE5Qgtkz0hxZg9vuvOJ2mlBMAxkNPTWi3vrJdAOCUfTIMsvGyiG x50N4oT3JQ8gXxWhihW8Rz7Uh2PzEvaw7nD6xzIwYStWWGc/Hw8BEuZv8BbEmuxLzLOX gVVzY4kacBsges34sYJ/Y42+D4ErnIWNuGUdzKaPqy318+f/t6pSss/klwB0Oa9rRXMQ /VWOGfHtxZGgRHtUDhsjnYDRPHQtViA8f0RhfQaNmWc+UXKiF17NK0J8eiZCdChvQ8l/ f78POasB5AF2Fkrfaj8Eeexiw+/O3FKHOucABJrtWqxeyCXewEzC47PlJMsesTVAUzhP pFZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752813080; x=1753417880; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KmVBlDYxDEXFwgW2S7JoN0otMjgoZ/G5ohJLcLsXyeY=; b=IJAXMTRHKGOC0iV1jrtVUeckppChcCkCEqYvaA9RL3YO8BNOmz8FZOnQpQRn1MvXul uoUzwxXih+jxninSuo3OHE9UtnHnvHwr9WpMXdtiVGi7+EyCpUFqTz9Y2MINFYhGsod9 kD1idHsXWYMqOE6O4tjhTx6cbr3EzXRNec+69QCDo2nUf4dY3gHHNF4zDDPjXusPXAVo lHt7cJPgsvhzw3ZJjjrvDN4MkLPgTUUs57y+IbFhAJGYAVrAADmJjZVjWMoAvreBYAjz gwAc6X0QX5XtASnX7JrO2q3/ljCn00IAb0coz4bSVb0PW60tDMecjZgYS283obsZf3i4 dvsw== X-Forwarded-Encrypted: i=1; AJvYcCUrKQaj9XkxWYjGRj6W50pKLbMIJjJauqcCLXTv8yecwuDhBMIv0gHwC2I9IXL9qjB5CS8YHwDbVmmL3A==@postgresql.org X-Gm-Message-State: AOJu0YzcQAL88jH1Ha/B7oeTaTpuwjXc4DLhFkClOjGHcAfLvRFbsHMX qqfA+KLspdXUC1qif1UDouD/Yz1hxQmOeAX4CydOPRYdGa9xVj6V8j0fAii/j07tRIk= X-Gm-Gg: ASbGnctNa5Fsy5YfoDSB6ohHRdmcH8b0XUuGMSsTqVc0XfdZxhxQhFIPtxMcdGRV3pQ 8oioOYy9fYvYX0BX9N2FIGTCH9eCPP6guw90btHk/uoSNjFeKQpxSXs9ry1GS6dG3bF75BlDQlj kjHB64VPQhjGfXJjC3ZIQ28bd5tlfQeCnF3c2sozJR6CaYe0xMVikAwjzreTgOHenZDzvVL5lUC siKpHW16RFyMq4EK5SAJxjNQSat7StfZ7ACEJbzwNLngDx2/drbXJ60jLKLRv4EWqxKPzVBH1Rp fVQsDUgLaLsfukYe6Aym2aWigp2cENZomgHFzZDyxOnn+KU+5+fGFtFgkEEcI7w/KqQCS5FTdtE SxGGYyRn2DcA/hEbkvDmSYtE70F73SRkf7h+tAaRifkhJGTO8xJ5k X-Google-Smtp-Source: AGHT+IH9ex8Hqf00b+7f0MdvF32n2U+CAIxSPhs83Ps2f32v6hJBVC41LPjo/ufSvgze3EkUf1VbmQ== X-Received: by 2002:a17:907:9406:b0:ae3:635c:53c1 with SMTP id a640c23a62f3a-aec6a66c93cmr128430466b.54.1752813079593; Thu, 17 Jul 2025 21:31:19 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:260:99eb:ca9d:7ee1:39c4:3753]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aec6c795282sm50028866b.6.2025.07.17.21.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jul 2025 21:31:19 -0700 (PDT) Message-ID: Subject: Re: VACUUM FREEZE vs plain VACUUM From: Laurenz Albe To: Ron Johnson , pgsql-admin Date: Fri, 18 Jul 2025 06:31:18 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-1.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2025-07-17 at 18:03 -0400, Ron Johnson wrote: > Does VACUUM FREEZE do something extra or special than to defer autovacuum > for an extra 50,000,000 transactions? What it does is set vacuum_freeze_table_age, vacuum_freeze_min_age, vacuum_multixact_freeze_table_age and vacuum_multixact_freeze_min_age to 0: if (params.options & VACOPT_FREEZE) { params.freeze_min_age =3D 0; params.freeze_table_age =3D 0; params.multixact_freeze_min_age =3D 0; params.multixact_freeze_table_age =3D 0; } So it's going to be an aggressive VACUUM. To quote the documentation: An aggressive scan differs from a regular VACUUM in that it visits every page that might contain unfrozen XIDs or MXIDs, not just those that might contain dead tuples. And it is going to freeze all tuples that are visible to everybody. The latter will advance "relfrozenxid" and "relminmxid" for the table, unless there is an open transaction or something similar that prevents freezing of a tuple. To answer your question: the extra thing it does is that it even visits table pages that have the all-visible flag set, that is, they contain no dead tuples. That means that it will do more work and use more of your system's resources. Yours, Laurenz Albe