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 1juzrr-0004ah-QF for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jul 2020 14:55:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juzro-0006bH-MZ for pgsql-admin@arkaria.postgresql.org; Mon, 13 Jul 2020 14:55:40 +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 1juzro-0006bA-Cr for pgsql-admin@lists.postgresql.org; Mon, 13 Jul 2020 14:55:40 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1juzrl-0003dh-J0 for pgsql-admin@lists.postgresql.org; Mon, 13 Jul 2020 14:55:40 +0000 Received: by mail-ed1-x542.google.com with SMTP id e22so13943657edq.8 for ; Mon, 13 Jul 2020 07:55:37 -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=rg8YYbArkxdBjURYhsDFgayPMy5dRypq+7SYe/V10m0=; b=ZHlzLYtuYvkgg+dXqzAFuH8rb5UX3PtuCzC2bxBt2NQLS27HuxnMNNDIGlp+T45Vr9 0xBw9eQwROy6nSofhIrYvIJFdy0t29l3iF+5NukzDm2icDJx+IcS1A1N1fn5NPEoibUY BsE7PWPU57vy4ZsySIYn1I9uQLcoR5CagwDBC2jmWOhozmQcaHUkayl0tqUVx5aQ8/9v X0VYLn2hpPJTpdHg3HEm6onGJ+1Yp3GJMmV9bwfmIH9ukIMCBzlVrqS5ZyB/1ePZvUWz TH+12Hxje7/rIqOnCdY9cOtpY5E7gQbfbZXFmnI8QYMMLhWxmlN3uHTLZD9G7Pi5/7Xl gp6g== 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=rg8YYbArkxdBjURYhsDFgayPMy5dRypq+7SYe/V10m0=; b=Q56RkzJStbC5ZzM5UI6juRdh4p34lDRwZiVimIgtb4klcGz3UMaIQufZFVjDnLAgHP iFaDqEOcYtg1j3ryUD6LWVq5SVIqudOmN2py9Z/zhlgX7IiFCFzv8OTP52O3uiwS6iwP 1Q+lVvkwZ569qNlZS2lKA63/txBEubhc+e1waG0xhpOEbzh7s4A2KTueQ4KNN6lKCmPt iJKlLWXMFPirVcWHGPbdMXr3BVXmEAxXNkd3PTDT+tBy2isXzBGX30eHAk3DQzRZpPMG GCaSSM62BrIc1Zr/wR7D1SIPla/WyoOwx6EYWzuduwnG6PuUuayOHDw4JNzlrhjrpsW9 8Mfg== X-Gm-Message-State: AOAM533OHB07r4TShW+nP+/s3qsliBdec2g1bwhCSdBLP1LNzg4olzXE kGQ6K76or+BsSgq3ijHhTTFmSw== X-Google-Smtp-Source: ABdhPJyz5erNCp5Ghe06hehtS+fJTQiofog6dPDJtRBstJUmpOadv30d8SMo/BIDsu8wXWloH/puGg== X-Received: by 2002:aa7:d44f:: with SMTP id q15mr87271716edr.340.1594652135374; Mon, 13 Jul 2020 07:55:35 -0700 (PDT) Received: from localhost.localdomain (217-149-169-12.nat.highway.telekom.at. [217.149.169.12]) by smtp.gmail.com with ESMTPSA id g21sm11685504edr.45.2020.07.13.07.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 07:55:33 -0700 (PDT) Message-ID: Subject: Re: Transaction Wraparound Help-Understanding From: Laurenz Albe To: Jerome Talbert , PostgreSQL Admin List Date: Mon, 13 Jul 2020 16:55:32 +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 Mon, 2020-07-13 at 10:40 -0400, Jerome Talbert wrote: > I'm trying to understand why autovacuum runs to prevent wraparound on tables that should > be static and don't change. For example, we have tables, in one of our databases, that > get created every day. Those tables are then actively updated throughout the day. > Once a new day begins, a new table is created for that days data. The previous days > table is no longer changed or updated and used for historical queries only. > > So, the way I understand transaction wrap around, I would think the only table needing > vacuuming to prevent wraparound, would be the active table? But, I also notice the older > tables getting vacuumed to prevent wrap around as well. Can someone help me understand this? Every table row that is not frozen contains transaction IDs that determine if it is visible or not. So even an insert-only static table hast te be vacuumed once, unless it has been loaded with COPY (FREEZE). You can do that yourself with VACUUM (FREEZE) or wait for the anti-wraparound vacuum. Once that has happened, the table will still reveive anti-wraparound vacuum runs, but these won't do anything. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com