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 1s1RxP-00COQp-MB for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2024 14:26:15 +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 1s1RxM-00HWtx-IR for pgsql-general@arkaria.postgresql.org; Mon, 29 Apr 2024 14:26:13 +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 1s1RxM-00HWtp-83 for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2024 14:26:13 +0000 Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1RxK-000cF1-Ai for pgsql-general@lists.postgresql.org; Mon, 29 Apr 2024 14:26:11 +0000 Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-47c5bf7aadaso157008137.0 for ; Mon, 29 Apr 2024 07:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714400769; x=1715005569; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dTSNLyiRdJOV4E92VlJQKFGZrauXNug+vmDRyVyq9jI=; b=msW3RIAmVJWVtW2co2LtAVfN+nUG9+1xpP4fW9DiTJZQHl4oCUFyA9+JTu7Wth4D2c 0xS2RBcL75ApmZkm349sQzm8/medJ0bUEsjKK8MnvuLCjjoLhRTopKHKkKaNhiUWJoyz ZbkLWjRO0GMulYnrKjhlqvjR5CKOf554UDJLF3TKwLsJcKfrlpw6bEggwRy/qs2x2Bzc mG2IyZhHn1dZ4qsNoHMoHpP2hDLoqi7h7JDCeXIho15z/6KZoghnWaw6x3TNCi4K3PNl AsblapRaLUQ0P3/EtyHFEoRAGyMwHrtdS6Jm8GnKav6XX2+XbK4ovlIR0lBPtkQJtU5A AmDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714400769; x=1715005569; h=cc: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=dTSNLyiRdJOV4E92VlJQKFGZrauXNug+vmDRyVyq9jI=; b=pKED+yHRCrKU2r2Hgcq/HAZvegx8NZR0i1KMKdUWZuGlRsI6eE4xSaC+0Lgo9NFm+d zIzOnSm/d1GcYdtCokvNkxOHis/Y+hfikNEBFNeigKvEwpMObAYKUbg/mVrdkJBxwxZy PjiDi+HDAnjbZhZ+jFr9bCl0soX9HCDOx5ZPleNELp0oaF6+Kg7CnxxLdCq2nQWDGxBK isR/pQy6VYbc7n/sL/QgAPNVeckn6fZDI93Qm1eD5BeHxd6yP+bHTS0J9YAEJj7zyra4 ajxTC1/+DxfaZgpTOlZeQ93NSbMhv54A4chRkPZQFmCGyCO7WqypS1fbiyHP0aP0e8d2 zFEg== X-Forwarded-Encrypted: i=1; AJvYcCWJjyKwaL3tKxiywr/XpTVZJrEK0QljcHRo9bidUzLKn8g/wm0Qd91q9jkBGnFYG5BrepvobDHTr/eWyheKlRvyfO8Ujtr+bcTDjtzdmhoE59Z6 X-Gm-Message-State: AOJu0YwAc7Isjs+N1ee8GlXEobsP3lZXJAVLQnuAPf8ZGi/Y2rpzirDy IUFMH5zBGnrqL5urv85u+OdPjRzhQIjdK5rVdorERMtYNaklSn3kcnQINCO9mzUAabFiOEb5xhC rx9FvSyhKVQq8RY5iktTgYjOh23E= X-Google-Smtp-Source: AGHT+IFAu/oE8FLdfBKL6SxBbvxM0TOoJ51xIjh0XIYs7g/exFYN9yOPl3IxQn0jRYRZ73pzf1DRMDG+YjvDTKUuIaM= X-Received: by 2002:a05:6122:1810:b0:4d3:4aad:1b9c with SMTP id ay16-20020a056122181000b004d34aad1b9cmr11146vkb.0.1714400768979; Mon, 29 Apr 2024 07:26:08 -0700 (PDT) MIME-Version: 1.0 References: <5874a355-51fb-4fa3-acf4-df81a6d5b5f0@aklaver.com> In-Reply-To: <5874a355-51fb-4fa3-acf4-df81a6d5b5f0@aklaver.com> From: Kashif Zeeshan Date: Mon, 29 Apr 2024 19:25:57 +0500 Message-ID: Subject: Re: Need help to make space on my database To: Adrian Klaver Cc: "Cocam' server" , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000d67c3c06173d0826" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d67c3c06173d0826 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please run VACUUM with ANALYZE option that will also update the DB Stats. Regards Kashif Zeeshan Bitnine Global On Mon, Apr 29, 2024 at 7:19=E2=80=AFPM Adrian Klaver wrote: > On 4/29/24 06:45, Cocam' server wrote: > > Hello. > > > > I need help to make space on my database. I have tables that are severa= l > > GB in size. I used to use the VACUUM FULL VERBOSE command; but now, thi= s > > command is too greedy in free space to be used and I'm looking for a wa= y > > to make free space (given back to the OS) > > > > Thanks in advance to everyone who responds > > Per > > https://www.postgresql.org/docs/current/sql-vacuum.html > > "VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL > operation, tuples that are deleted or obsoleted by an update are not > physically removed from their table; they remain present until a VACUUM > is done. Therefore it's necessary to do VACUUM periodically, especially > on frequently-updated tables. > > <...> > > Plain VACUUM (without FULL) simply reclaims space and makes it available > for re-use. This form of the command can operate in parallel with normal > reading and writing of the table, as an exclusive lock is not obtained. > However, extra space is not returned to the operating system (in most > cases); it's just kept available for re-use within the same table. > " > > So a regular VACUUM should work if all you want to do is give the > database the ability to recycle the vacuumed tuple space. > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > > --000000000000d67c3c06173d0826 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Please run VACUUM with ANALYZE option that will also = update the DB Stats.

Regards
Kashif Zees= han
Bitnine Global

=
On Mon, Apr 29, 2024 at 7:19=E2=80=AF= PM Adrian Klaver <adrian.kl= aver@aklaver.com> wrote:
On 4/29/24 06:45, Cocam' server wrote:
> Hello.
>
> I need help to make space on my database. I have tables that are sever= al
> GB in size. I used to use the VACUUM FULL VERBOSE command; but now, th= is
> command is too greedy in free space to be used and I'm looking for= a way
> to make free space (given back to the OS)
>
> Thanks in advance to everyone who responds

Per

https://www.postgresql.org/docs/current/sql-v= acuum.html

"VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL=
operation, tuples that are deleted or obsoleted by an update are not
physically removed from their table; they remain present until a VACUUM is done. Therefore it's necessary to do VACUUM periodically, especially=
on frequently-updated tables.

<...>

Plain VACUUM (without FULL) simply reclaims space and makes it available for re-use. This form of the command can operate in parallel with normal reading and writing of the table, as an exclusive lock is not obtained. However, extra space is not returned to the operating system (in most
cases); it's just kept available for re-use within the same table.
"

So a regular VACUUM should work if all you want to do is give the
database the ability to recycle the vacuumed tuple space.

--
Adrian Klaver
adrian.klave= r@aklaver.com



--000000000000d67c3c06173d0826--