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 1jQSDn-0005MP-OC for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 08:56:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jQSDm-0004VK-IY for pgsql-admin@arkaria.postgresql.org; Mon, 20 Apr 2020 08:56:06 +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 1jQSDm-0004VC-7L for pgsql-admin@lists.postgresql.org; Mon, 20 Apr 2020 08:56:06 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jQSDe-0002mM-8T for pgsql-admin@postgresql.org; Mon, 20 Apr 2020 08:56:05 +0000 Received: by mail-wr1-x436.google.com with SMTP id b11so11080082wrs.6 for ; Mon, 20 Apr 2020 01:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=dTkaIaUmC1QwUH3LF4BVH3y/jYVz2fCcsJ/KOoOOhRg=; b=NaxSOc6ng6ara5g3cZ3rPyHn8a6HcR/y35p7H6T1Lc6TDrKDBFsIjMMLIWTFNRpjoq M1AevoDNERTqu4n2Gal9qJ2uuf4toGAAiduoAPC0JNadQ2D3l6sUOVTMl6ff9CSrFMGp PtzccaoJ/xK1AtlcWD+EyT46bdDgqbbpPn33fthJGrJImdWaDWWDO29fcTiJLijr+6Yi Dw4hJaBUROJVRTrSYwxIegBr+aAlbm/hKjNUzk7XLlFfwkdyDBt6G05VDFIyQ7QtUwW2 wudPtfF+dTZ0prZd7CYiUXa5TL6DxIlvu2Uy54nlM4QsdIuPq52L/DQ5iSTQ+Gf/pHOc xuIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=dTkaIaUmC1QwUH3LF4BVH3y/jYVz2fCcsJ/KOoOOhRg=; b=oQlNPBMnXgJyZd79u4PbLHN9TjbpLUHUBgnORiVk0ddbGRgcMdc2gr1FRq6xI/aHMC CnMhH6qy25ocwKHbNT2oa6Cw6586YkaJlPoupKyDPHtz8ySymisl90c2UCP9AZuId/7Q FNgVC0prLboyEmtR14RTI84ymMqMn5RzAXOabqWMwhWxZQ+HELqrvt5XTGBMeQKhdASh aLJlsPx5tMOTzhA9ideaXPZsUYS0CQPQy5Ppo9NYZ9PdDQpUQr6cGbeqsmuErh8PFOyf XXKk3HrmUJGnxdMFcMaa1viT+fEE9gXWT0ZilULIsE2s9D6p9FZPNKYjJc4zwR7VCsSv TU6A== X-Gm-Message-State: AGi0PuZy8YDGMNlnd9RT7It66HGOIv+w6Y1a03J9uhoen3Wmry4Q42Ev q6wYPChjOEB8COJL+3Hfql21zA== X-Google-Smtp-Source: APiQypKGH12ElQ0AuM1VEzzBNi37ScJQFBOkkasZbouoVQcSpDoLRCeysR27YrrlH9SrYg0Tb3/kyg== X-Received: by 2002:adf:9cc8:: with SMTP id h8mr16899556wre.167.1587372957324; Mon, 20 Apr 2020 01:55:57 -0700 (PDT) Received: from dynamic-eoa1xw1q44qdjznxo-pd01.res.v6.highway.a1.net (dynamic-eoa1xw1q44qdjznxo-pd01.res.v6.highway.a1.net. [2001:871:60:9afb:eb30:1de6:8277:4aec]) by smtp.gmail.com with ESMTPSA id m15sm432225wmc.35.2020.04.20.01.55.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 01:55:56 -0700 (PDT) Message-ID: <8042edc6f769a8577ee36b1167e355f254141d97.camel@cybertec.at> Subject: Re: VACUUM freeze From: Laurenz Albe To: Arnav , pgsql-admin Date: Mon, 20 Apr 2020 10:55:56 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, 2020-04-18 at 23:55 +0530, Arnav wrote: > what is VACUUM freeze , does it not allow autovacuum to happen ever. > if yes till how long? VACUUM (FREEZE) marks all rows that are visible to everybody as unconditionally visible. All rows that live long have to get frozen at some point, so that they can survive transaction wraparound without data corruption, because the internal transaction ID that created them is stored in the row metadata. This can be useful for insert-only tables, since autovacuum won't have to touch frozen rows ever again unless they get updated or deleted. The negative aspect of freezing all rows is that all rows that are frozen get modified, which means that the block containing them becomes dirty and has to be written to disk again. Now if any such row is modified or deleted later, freezing the row has generated unnecessary I/O. This is why by default VACUUM will freeze only rows whose creating transaction is more then 50 million transactions in the past, in the hope that such rows have less chance to be modified again than more recent rows. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com