Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fktrt-0002N5-57 for pgsql-general@arkaria.postgresql.org; Wed, 01 Aug 2018 16:20:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fktrq-0004r0-MI for pgsql-general@arkaria.postgresql.org; Wed, 01 Aug 2018 16:20:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fktrL-0002RT-5K for pgsql-general@lists.postgresql.org; Wed, 01 Aug 2018 16:20:23 +0000 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fktrH-0001vV-AQ for pgsql-general@postgresql.org; Wed, 01 Aug 2018 16:20:22 +0000 Received: by mail-qt0-x242.google.com with SMTP id h4-v6so20508666qtj.7 for ; Wed, 01 Aug 2018 09:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=cxaqt2TPA5pi1Gcs4zEhsHfm8Bwx3AqHkngP640r3Mg=; b=wcVB3/awstMB0w7N6OWvMQtBvv8rGbRVS01AQd3K3PANgpfWWwVu6RpA/k5zWHRilp r5tcNC9x7ilyatxL0srDcoVZCagN8XIMdFtNh/Cowov0/eYrwqKt2LsIJqM1GdEHs7Ch nxD2c6+DMDaVWAtzm7OPrT4ctgtvRwmqh5QoD4CbUo/BL/u0JvsRAcZqR7MPEDanqcfC rbQJNqMwZYXr2QH1ed8R+92BhO67KIiV725tQj4cZRh06VNh5Lo5cvM1juKYvrkgYQvr uNe6PFXsGZ5B1wrogXwyiOGGy2vyT7iFl1IoXPd6o/HjHbmPi1dFsxHzBSF5klhLLHPm 84kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=cxaqt2TPA5pi1Gcs4zEhsHfm8Bwx3AqHkngP640r3Mg=; b=H/BjUr8UJmss+P6LLmo+BrEFNEuJHJvrnEY7lAp9Zm4z0W+T0CyXJ6S4SGLFcuswPo kOzss2f6DGvfro3hWanoZeI9eWLwF9pmxBZbHFQFHbUnb53N+K7XX7By40Y9oq4JzJCe GLT5Akz6H57PqxV/Ef4xnkQsgLcKQozZYZhGY78HLlJwgiM98KMX8aLWSEWbg0zgjwO1 ivHMM9cfnuLrYIzMnUtDUVRetbckpayaXiPel78RB11Uy+iiPq4fokJvvMR1N1f8UoHF MGtRP7o2zjyzw3fy8i+YvxwdB0vsDoycHK6WRxJVZFw3/UxVx89hNfdCQip8ZqdX20jh 1dpA== X-Gm-Message-State: AOUpUlGLdbQkQzGHLTfFXvcLFs3T3biVcc2eckplrm7fMVxDDtbh2hHw eK03m6o0Spg6bhk16Wrjy7FERg== X-Google-Smtp-Source: AAOMgpfZjtIMoAujNRReZiXW0zJyaBfH6GiN21G3/cXzeGanvBwKhaX77LMjNKabzDepjaAHF2OdUg== X-Received: by 2002:a0c:aa06:: with SMTP id d6-v6mr23485396qvb.26.1533140417683; Wed, 01 Aug 2018 09:20:17 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id l44-v6sm15446786qtb.58.2018.08.01.09.20.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Aug 2018 09:20:17 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id D537FE10; Wed, 1 Aug 2018 12:20:15 -0400 (-04) Date: Wed, 1 Aug 2018 12:20:15 -0400 From: Alvaro Herrera To: Andres Freund Cc: Tom Lane , "rjo_roy@yahoo.com" , "pgsql-general@postgresql.org" Subject: Re: Template0 datfrozenxid age is 160million and progressing Message-ID: <20180801162015.kghi6rnhmy2rdkow@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180801161227.hmblujrvstqsubow@alap3.anarazel.de> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Aug-01, Andres Freund wrote: > On 2018-08-01 12:07:16 -0400, Tom Lane wrote: > > Andres Freund writes: > > > On 2018-08-01 10:24:24 -0400, Tom Lane wrote: > > >> IMO, the action you need to take is enabling autovacuum. We've > > >> seen many many people go down the path you are taking, and it's > > >> generally led to no good in the end. Manual vacuuming tends > > >> to miss stuff, and it cannot react adequately to activity spikes. > > > > > But it shouldn't matter here, autovacuum will start regardless, no? > > > > Sure, once it decides that emergency anti-wraparound vacuuming is > > necessary. I really doubt the OP wants that to happen; it's the > > exact opposite of non-intrusive. > > That's solely what would trigger it were autovacuum enabled, too? I've > complained about "emergency anti-wraparound" beeing anything but > emergency (they're largely unavoidable unless you manually script it), > but they're what happen once autovacuum_freeze_max_age is reached, and > that's the only trigger for vacuuming old relations independent of other > activity? With a small database like template0, it doesn't matter. The vacuuming is going to be over before OP realizes it has happened anyway. Certainly having it happen on a normal-sized table can become problematic, but presumably OP has taken steps to avoid it when disabling autovacuum (which is why only template0 is getting into trouble.) I think emergency vacuum should behave differently (not scan indexes, just apply HOT page prune and clear old XIDs/multixacts), which would make it much faster, but that's a separate line of thought (and of development). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services