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 1sc0M0-0038NZ-Ve for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2024 10:26:44 +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 1sc0Lz-00DONF-DU for pgsql-admin@arkaria.postgresql.org; Thu, 08 Aug 2024 10:26:43 +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 1sc0Lz-00DON4-20 for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2024 10:26:43 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sc0Ls-003gzD-LQ for pgsql-admin@lists.postgresql.org; Thu, 08 Aug 2024 10:26:41 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-70d18d4b94cso633651b3a.2 for ; Thu, 08 Aug 2024 03:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723112795; x=1723717595; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=wbjoWHOeUQE2YNaLUT39b4XUCaALUch3tLiV7WZYD6I=; b=iLaS4e9HBOeNk0WLmbjvBQIqEXebCovU4ohCUknjqW/YLtVuW6AvuiPpDnmWQ4x3kX 4GzpOgOjzu0QekI6QddDDjeqC5I6N66+zHutbHr7+QrfQbCioqNg2ncgUn+2RvBBdg/z uRZWs4YKJdiKDAdvsyntIch61E9GlN2GvE/sHtP3wzUblSBBLdtd0SdSXFsLxbn8Fvqk jFDnYzNBkUgDDKxDQAOyh4jZxowjCxxYruUBCFoajUFxvZVfWyK7GHpJguOmAozH0pgT Hk2OeY0v6Sm2gbLovDFBY3BcD9aFOTyxC+u3fIo35py+rKmE8I/o/rOvaJqHQEDSwhjl lQHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723112795; x=1723717595; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wbjoWHOeUQE2YNaLUT39b4XUCaALUch3tLiV7WZYD6I=; b=L134fFnF8TBJl9cZgETneZvzT6i/pk31UjJoAo0KM3wXXOyHB2vpoYVLHz9t0Ws6CE zh6e9OTM9xzfRkmMYnTBCnJR4MGF3qYw7cTTL6d0uIVxdUBAFU9NGd4hRY0b+Ivl+D07 yp5hTrUeGCxcSr1bOQlBpZt0RuT3jKprr5QQvXaSeMML9ISYthufSeihTToql5VodW4a YXrAXhQ15Ozk8Gm9ydjZTUSUIXjDgQDxk6QRBzhhevMNjF86eZDUuCSowAmIx9reBSMu o1COBm/RrJu4mITAS6NQELws9S0WhBUw7Auw3266nfd5xFvTWPckaDL+t9m3yhzj/xIu ZiXg== X-Gm-Message-State: AOJu0YxPmW0Vmyk+Nr4AWUAEt01urvzC6+B8l5ljW5t2nl0txyuiHTu6 dOmuvwNF0YFvNig/XQ64b/F3KjGslT0BlytMlChR8p7i+AdQh1GeaxCIVXqnWfcQJOoa/MtL/Q9 Ha0ukFwphOdr6PQNN8OFhp0OfnWghhA== X-Google-Smtp-Source: AGHT+IE0+rendPGB6FLK8o8aOhlqCWXVO8AdTAGL8aqvVQ7HxE5bJmNu5VTARI4BJD9wbS8Hmh0wrLZMX3tsepfK+O0= X-Received: by 2002:a05:6a21:620:b0:1c6:faba:14a4 with SMTP id adf61e73a8af0-1c6fcf999a4mr1126483637.41.1723112794628; Thu, 08 Aug 2024 03:26:34 -0700 (PDT) MIME-Version: 1.0 References: <69C14B4B-0DED-442A-BD74-3CABA4DD64BD@icloud.com> In-Reply-To: From: Ron Johnson Date: Thu, 8 Aug 2024 06:26:22 -0400 Message-ID: Subject: Re: Schedule pg_repack job with pg_cron To: Pgsql-admin Content-Type: multipart/alternative; boundary="000000000000082a37061f297602" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000082a37061f297602 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 8, 2024 at 6:17=E2=80=AFAM wrote: > > Ron Johnson schrieb am 07.08.2024 um 21:39: > > Part of a properly-maintained system is *regularly* archive/purging > > (whether that be dropping date-based partitions, or deleting old > > data from unpartitioned tables or tables partitioned by something > > other than a date). > > > > For example, I gave a list of tables (all intertwined via FK > > constraints) to the application support people, and they returned > > the list stating how many weeks or months of data to retain in each > > table. Every Saturday night a cron job goes through and deletes the > > old data from, and then "manually" vacuum-analyzes them. > > > If the application will then insert new data after the cleanup, Postgres > will re-use the free space that the delete "created". So depending > on the speed of inserts, you might not really gain that much. > Eh? The whole point of VACUUM is to ensure that the existing allocated disk space is available for new records? Or did you think that I do a VACUUM FULL on those tables? (No; I definitely don't do that, though I *occasionally* CLUSTER *some* of the tables to make range queries more efficient.) --=20 Death to America, and butter sauce. Iraq lobster! --000000000000082a37061f297602 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Aug 8, 2024 at 6:17=E2=80=AFAM &l= t;shammat@gmx.net> wrote:

Ron Johnson schrieb am 07.08.2024 um 21:39:
> Part of a properly-maintained system is *regularly* archive/purging > (whether that be dropping date-based partitions, or deleting old
> data from unpartitioned tables or tables partitioned by something
> other than a date).
>
> For example, I gave a list of tables (all intertwined via FK
> constraints) to the application support people, and they returned
> the list stating how many weeks or months of data to retain in each > table.=C2=A0 Every Saturday night a cron job goes through and deletes = the
> old data from, and then "manually" vacuum-analyzes them.


If the application will then insert new data after the cleanup, Postgres will re-use the free space that the delete "created". So dependin= g
on the speed of inserts, you might not really gain that much.

Eh?=C2=A0 The whole point of VACU= UM is to ensure that the existing allocated disk space is available for new= records?

Or did you think that I do a VACUUM FULL= on those tables?=C2=A0 (No; I definitely don't do that, though I oc= casionally=C2=A0CLUSTER some=C2=A0of the tables to make range qu= eries more efficient.)

--
Death to America, and butter sauce.
Iraq lobster!
--000000000000082a37061f297602--