Re: vacuum vs vacuum full

From: Olivier Gautherot <ogautherot(at)gautherot(dot)net>
To: Atul Kumar <akumar14871(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: vacuum vs vacuum full
Date: 2020-11-18 09:41:37
Message-ID: CAJ7S9TWGN01KhO636AWFUVtEFqMkRtf6qaPH6B9VkaN_4spORg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Atul,

On Wed, Nov 18, 2020 at 9:33 AM Atul Kumar <akumar14871(at)gmail(dot)com> wrote:

> Hi,
>
> We have a table of 3113GB, and we are planning to vacuum it in non
> business hours i.e. 12AM to 4AM, So my queries are:
>
> 1. What should be perform on the table Vacuum or Vacuum full ?
>

Vacuum full will do a complete rewrite of the table so you need to make
sure that you have the necessary space. I would recommend a simple
VACUUM, although it won't return the extra space to the OS.

> 2. Do we need to perform Analyze also?
>

It would be a good thing.

> 3. Will the operation be completed in the given time frame? how to
> check the same.
>

Given the size of the table, it will probably take several days.

> 4. Who acquire lock on table vacuum or vacuum full.
>

VACUUM FULL acquires a lock on the table. VACUUM doesn't.

> 5. If the activity goes beyond time frame, do we have any option to do
> continue doing t without acquiring lock on the table ?
>

VACUUM is a background activity. It does not block any other activity.

>
> If you also need the structure of the table, Please let me know.
>

It would be interesting to know the number of rows updated per hour or per
day to have an estimation of the needs.

> Please help me by responding my query wise.
>
> Regards,
> Atul
>

Cheers
Olivier

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#m_-5414522580965465877_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2020-11-18 09:44:59 Re: vacuum vs vacuum full
Previous Message Ron 2020-11-18 09:38:14 Re: vacuum vs vacuum full