Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEatE-0008CT-7L for pgsql-general@arkaria.postgresql.org; Thu, 11 Apr 2019 14:41:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hEatC-0008Ir-O0 for pgsql-general@arkaria.postgresql.org; Thu, 11 Apr 2019 14:41:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEatC-0008Ii-6y for pgsql-general@lists.postgresql.org; Thu, 11 Apr 2019 14:41:18 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEat8-0003dZ-Vb for pgsql-general@postgresql.org; Thu, 11 Apr 2019 14:41:16 +0000 Received: by mail-qt1-x844.google.com with SMTP id w5so7288565qtb.11 for ; Thu, 11 Apr 2019 07:41:14 -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=egkuP1wVvKcEWf6K94mgLQ8YMws9atMvMiANasH+rZ0=; b=akoK8WUgfDq2iQMONjhtSK2aajn0LgROR29fNFBEd4Oyrw9378rGHOWZOVWfdrY04z sxVcqgQ+8z9m+cCaXmgg330gWF8Wks5QzdnTlZDp4xD7rlokWIbZkHSR1ngvmFjUgP7H ucGu5wgl98nIXma/6aWBbrm4MUs+aW/zeBC1WN49ieb0+Cu1t77runoSsY8O2xSjfslz ikK9LxVr05rXOEXrMsF7iUBRcc+Njqv5z062kkBJVIO32Eje93s22CHNNrlZ7WHdfYWD F302kgn0Z9HKQhZ2qS0kwPBvmojdEI1cIKmqYI4heAV3Lr9b6IlIUdrj8qizykckAjqR UfGA== 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=egkuP1wVvKcEWf6K94mgLQ8YMws9atMvMiANasH+rZ0=; b=HTmqVGpCHUnjQO1DXUi5ow5ajFTL8sdsMOr81xRSNtcKecu1wftxaMj6/PPfEq01xN lplio4BD7Ay5bFdMydieHIBnVWdPUd4JzD7pZ3nP31FyI5n8nosUzgbIaozmx4DfkFvf 1tD4sTgFZIyA+shi+RD08fCJ1Hd14BitG9XZ+vDGK0MiKAdwZP/arIWt0Q/QWkr+/Uep Qpl6vUo/U0BfgCOsSfzz14mdjvUHj6QYUdqj27s0y5d3vlr/qp9zB9yho9VP+r8CgQpx D0RQ4S4B8wv/8M5C6hy5HL6zrn0FvkIjvDReOYom8xS14LnfvqU6pasgU132lMJ1S8Wa fOaA== X-Gm-Message-State: APjAAAXuJFdCXYBmSnpWyhETFux/Xe9RoBaVJjp0v41F59JN6gOhPm6U 5ssSqNyGFH9MakENR9Y20IG2dA== X-Google-Smtp-Source: APXvYqzyPLxfBUIOMOLPH2d0MQOMclllYKtcuUDqdjw8EXzSVV0Qy5ctAz9dpZXtiXKIfIk+L1kcwg== X-Received: by 2002:a0c:d0bd:: with SMTP id z58mr17731659qvg.121.1554993673732; Thu, 11 Apr 2019 07:41:13 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x28sm26531579qtx.71.2019.04.11.07.41.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2019 07:41:13 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id E0EAF120FBE; Thu, 11 Apr 2019 10:41:10 -0400 (-04) Date: Thu, 11 Apr 2019 10:41:10 -0400 From: Alvaro Herrera To: rihad Cc: Tom Lane , pgsql-general General Subject: Re: When do vacuumed pages/tuples become available for reuse? Message-ID: <20190411144110.GA27020@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17dafb0f-5ab9-390e-96b0-2280d654f790@mail.ru> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Apr-11, rihad wrote: > On 04/11/2019 06:20 PM, Tom Lane wrote: > > rihad writes: > > > Thanks! Our autovacuum_work_mem = 1GB, so this probably means any space > > > would be available for reuse only at the end of the vacuum? > > It's six bytes per dead tuple, last I checked ... you do the math. > > > > > Are there > > > any downsides in decreasing it to, say, 64MB? I see only pluses ) > > Well, usually people prefer to minimize the number of passes over > > the indexes. > Yup, it's just that n_dead_tuples grows by several hundred thousand (the > table sees much much more updates than inserts) and disk usage grows > constantly between several hour long vacuum runs. Running vacuum full isn't > an option. Perhaps it'd be better to vacuum this table much more often. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services