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 1sZyty-005kDn-33 for pgsql-admin@arkaria.postgresql.org; Fri, 02 Aug 2024 20:29: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 1sZytw-0039u0-Im for pgsql-admin@arkaria.postgresql.org; Fri, 02 Aug 2024 20:29:24 +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 1sZytw-0039ts-8F for pgsql-admin@lists.postgresql.org; Fri, 02 Aug 2024 20:29:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sZytt-002lXA-MZ for pgsql-admin@lists.postgresql.org; Fri, 02 Aug 2024 20:29:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 472KTJWc4023042; Fri, 2 Aug 2024 16:29:19 -0400 From: Tom Lane To: Scott Ribe cc: Pgsql-admin Subject: Re: measuring WAL creation In-reply-to: <7058A015-F907-4182-BF9F-9E6904620197@elevated-dev.com> References: <7058A015-F907-4182-BF9F-9E6904620197@elevated-dev.com> Comments: In-reply-to Scott Ribe message dated "Fri, 02 Aug 2024 13:16:06 -0600" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4023040.1722630559.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 02 Aug 2024 16:29:19 -0400 Message-ID: <4023041.1722630559@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Scott Ribe writes: > I'd like to measure both the amount of WAL created by a long series of d= ata modifications and the compressed size of the generated WAL files. > I suppose I need to set wal_keep_size high, and pay attention to segment= numbers to make sure it was high enough. Then I can look at segments crea= ted while the commands were running. > But question: can I simply delete all WAL after a clean shutdown? As a general rule, never do that manually --- the risk/reward ratio is unattractive. A checkpoint will release all safely-releasable WAL. You can checkpoint via a shutdown if you insist, but a plain CHECKPOINT command should be enough. regards, tom lane