pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Vacuum Vs Vacuum Full
19+ messages / 12 participants
[nested] [flat]

* Vacuum Vs Vacuum Full
@ 2008-08-05 06:04 Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
  0 siblings, 1 reply; 19+ messages in thread

From: Robert Shaw @ 2008-08-05 06:04 UTC (permalink / raw)
  To: pgsql-general


Hi,

I've been trying to get to the bottom of the differences between a vacuum and a vacuum full, it seems to me that the difference is that a vacuum full also recovers disk space(and locks things making it less than useful on production servers).  But I believe that both will fix the transaction ID(example message below).

"WARNING:  database "mydb" must be vacuumed within 177009986 transactions
HINT:  To avoid a database shutdown, execute a full-database VACUUM in "mydb"."Which is reason I ask the question, is full vacuum backup useful for anything other than reclaiming disk space.

On a side note, we doubled our page slots, but they ran out much faster(of course) than we thought, is there a good sql statement that can tell you what your current transaction ID is?

Thanks in advance.

Cheers,
Rob

_________________________________________________________________
Are you paid what you're worth? Find out: SEEK Salary Centre
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2Eau%2Fcareer%2Dresources%2Fsal...

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
@ 2008-08-05 13:20 ` Adrian Klaver <aklaver@comcast.net>
  2008-08-05 15:21   ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
  0 siblings, 1 reply; 19+ messages in thread

From: Adrian Klaver @ 2008-08-05 13:20 UTC (permalink / raw)
  To: pgsql-general; +Cc: Robert Shaw <redsmurfau@msn.com>

On Monday 04 August 2008 11:04:00 pm Robert Shaw wrote:
> Hi,
>
> I've been trying to get to the bottom of the differences between a vacuum
> and a vacuum full, it seems to me that the difference is that a vacuum full
> also recovers disk space(and locks things making it less than useful on
> production servers).  But I believe that both will fix the transaction
> ID(example message below).
>
> "WARNING:  database "mydb" must be vacuumed within 177009986 transactions
> HINT:  To avoid a database shutdown, execute a full-database VACUUM in
> "mydb"."Which is reason I ask the question, is full vacuum backup useful
> for anything other than reclaiming disk space.
>
> On a side note, we doubled our page slots, but they ran out much faster(of
> course) than we thought, is there a good sql statement that can tell you
> what your current transaction ID is?
>
> Thanks in advance.
>
> Cheers,
> Rob
>

Actually its not asking for a VACUUM FULL but a VACUUM of the full database, 
instead of selected tables.

See below for complete details
http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND




-- 
Adrian Klaver
aklaver@comcast.net



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
@ 2008-08-05 15:21   ` Matthew T. O'Connor <matthew@zeut.net>
  2008-08-05 15:23     ` Re: Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 16:36     ` Re: Vacuum Vs Vacuum Full Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 19+ messages in thread

From: Matthew T. O'Connor @ 2008-08-05 15:21 UTC (permalink / raw)
  To: Adrian Klaver <aklaver@comcast.net>; +Cc: pgsql-general@postgresql.org, Robert Shaw <redsmurfau@msn.com>

Adrian Klaver wrote:
> On Monday 04 August 2008 11:04:00 pm Robert Shaw wrote:
>> "WARNING:  database "mydb" must be vacuumed within 177009986 transactions
>> HINT:  To avoid a database shutdown, execute a full-database VACUUM in
>> "mydb"."Which is reason I ask the question, is full vacuum backup useful
>> for anything other than reclaiming disk space.
> 
> Actually its not asking for a VACUUM FULL but a VACUUM of the full database, 
> instead of selected tables.
> 
> See below for complete details
> http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND


BTW, what version of PostgreSQL is this?  Database-wide vacuum is no 
longer required for XID wraparound issues.  I think this was an 8.3 
change but might have happened in 8.2, I don't remember.

Matt



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
  2008-08-05 15:21   ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
@ 2008-08-05 15:23     ` Robert Shaw <redsmurfau@msn.com>
  1 sibling, 0 replies; 19+ messages in thread

From: Robert Shaw @ 2008-08-05 15:23 UTC (permalink / raw)
  To: Matthew T. O'Connor <matthew@zeut.net>; Adrian Klaver <aklaver@comcast.net>; +Cc: pgsql-general


Its 8.1 and I'm doing a Vacuum using the vacuumdb program.

Thanks Matt, might be time for an upgrade.

> Date: Tue, 5 Aug 2008 11:21:44 -0400
> From: matthew@zeut.net
> To: aklaver@comcast.net
> CC: pgsql-general@postgresql.org; redsmurfau@msn.com
> Subject: Re: [GENERAL] Vacuum Vs Vacuum Full
> 
> Adrian Klaver wrote:
> > On Monday 04 August 2008 11:04:00 pm Robert Shaw wrote:
> >> "WARNING:  database "mydb" must be vacuumed within 177009986 transactions
> >> HINT:  To avoid a database shutdown, execute a full-database VACUUM in
> >> "mydb"."Which is reason I ask the question, is full vacuum backup useful
> >> for anything other than reclaiming disk space.
> > 
> > Actually its not asking for a VACUUM FULL but a VACUUM of the full database, 
> > instead of selected tables.
> > 
> > See below for complete details
> > http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
> 
> 
> BTW, what version of PostgreSQL is this?  Database-wide vacuum is no 
> longer required for XID wraparound issues.  I think this was an 8.3 
> change but might have happened in 8.2, I don't remember.
> 
> Matt

_________________________________________________________________
It's simple! Sell your car for just $40 at CarPoint.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fc...

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
  2008-08-05 15:21   ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
@ 2008-08-05 16:36     ` Tom Lane <tgl@sss.pgh.pa.us>
  2008-08-05 16:54       ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
  1 sibling, 1 reply; 19+ messages in thread

From: Tom Lane @ 2008-08-05 16:36 UTC (permalink / raw)
  To: Matthew T. O'Connor <matthew@zeut.net>; +Cc: Adrian Klaver <aklaver@comcast.net>; pgsql-general@postgresql.org, Robert Shaw <redsmurfau@msn.com>

"Matthew T. O'Connor" <matthew@zeut.net> writes:
>> On Monday 04 August 2008 11:04:00 pm Robert Shaw wrote:
>>> "WARNING:  database "mydb" must be vacuumed within 177009986 transactions
>>> HINT:  To avoid a database shutdown, execute a full-database VACUUM in
>>> "mydb".

> BTW, what version of PostgreSQL is this?  Database-wide vacuum is no 
> longer required for XID wraparound issues.  I think this was an 8.3 
> change but might have happened in 8.2, I don't remember.

8.2.  But you could still get that message, even in CVS HEAD, if
autovacuum was failing to complete for some reason (and had been
failing for quite a long time).

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
  2008-08-05 15:21   ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
  2008-08-05 16:36     ` Re: Vacuum Vs Vacuum Full Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-08-05 16:54       ` Matthew T. O'Connor <matthew@zeut.net>
  2008-08-05 17:15         ` Re: Vacuum Vs Vacuum Full Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 19+ messages in thread

From: Matthew T. O'Connor @ 2008-08-05 16:54 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <aklaver@comcast.net>; pgsql-general@postgresql.org, Robert Shaw <redsmurfau@msn.com>

Tom Lane wrote:
> "Matthew T. O'Connor" <matthew@zeut.net> writes:
>> BTW, what version of PostgreSQL is this?  Database-wide vacuum is no 
>> longer required for XID wraparound issues.  I think this was an 8.3 
>> change but might have happened in 8.2, I don't remember.
> 
> 8.2.  But you could still get that message, even in CVS HEAD, if
> autovacuum was failing to complete for some reason (and had been
> failing for quite a long time).

Should that message to updated since a database-wide vacuum is no longer 
required, or are you saying that the message is still relevant is some 
corner cases?



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: Vacuum Vs Vacuum Full
  2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
  2008-08-05 13:20 ` Re: Vacuum Vs Vacuum Full Adrian Klaver <aklaver@comcast.net>
  2008-08-05 15:21   ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
  2008-08-05 16:36     ` Re: Vacuum Vs Vacuum Full Tom Lane <tgl@sss.pgh.pa.us>
  2008-08-05 16:54       ` Re: Vacuum Vs Vacuum Full Matthew T. O'Connor <matthew@zeut.net>
@ 2008-08-05 17:15         ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 19+ messages in thread

From: Tom Lane @ 2008-08-05 17:15 UTC (permalink / raw)
  To: Matthew T. O'Connor <matthew@zeut.net>; +Cc: Adrian Klaver <aklaver@comcast.net>; pgsql-general@postgresql.org, Robert Shaw <redsmurfau@msn.com>

"Matthew T. O'Connor" <matthew@zeut.net> writes:
> Tom Lane wrote:
>> 8.2.  But you could still get that message, even in CVS HEAD, if
>> autovacuum was failing to complete for some reason (and had been
>> failing for quite a long time).

> Should that message to updated since a database-wide vacuum is no longer 
> required, or are you saying that the message is still relevant is some 
> corner cases?

I think the message is okay as-is, or at least that the code doesn't
have the information available to do better --- it knows which database
is the most problematic, but not which table(s) within that DB most need
vacuuming.  So the easiest manual fix is still a DB-wide vacuum.
Besides which, if you've got one problem table then you've probably got
more than one.

The odds of anyone seeing this message in the field in 8.2 or later seem
pretty remote anyway, so I'm not feeling like we should expend
tremendous effort to make it better.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* vacuum vs vacuum full
@ 2020-11-18 08:33 Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:38 ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 15:11 ` Re: vacuum vs vacuum full David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 3 replies; 19+ messages in thread

From: Atul Kumar @ 2020-11-18 08:33 UTC (permalink / raw)
  To: pgsql-general

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 ?
2. Do we need to perform Analyze also?
3. Will the operation be completed in the given time frame? how to
check the same.
4. Who acquire lock on table vacuum or vacuum full.
5. If the activity goes beyond time frame, do we have any option to do
continue doing t without acquiring lock on the table ?

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

Please help me by responding my query wise.



Regards,
Atul





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
@ 2020-11-18 09:38 ` Ron <ronljohnsonjr@gmail.com>
  2 siblings, 0 replies; 19+ messages in thread

From: Ron @ 2020-11-18 09:38 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 11/18/20 2:33 AM, Atul Kumar 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 ?

The documentation *clearly states* the difference between VACUUM and VACUUM 
FULL.

https://www.postgresql.org/docs/9.6/sql-vacuum.html

> 2. Do we need to perform Analyze also?

I always do.

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

How in the heck do we know your system's hardware configuration?

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

Read the docs.

> 5. If the activity goes beyond time frame, do we have any option to do
> continue doing t without acquiring lock on the table ?
>
> If you also need the structure of the table, Please let me know.
>
> Please help me by responding my query wise.


-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
@ 2020-11-18 09:41 ` Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2 siblings, 1 reply; 19+ messages in thread

From: Olivier Gautherot @ 2020-11-18 09:41 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general

Hi Atul,

On Wed, Nov 18, 2020 at 9:33 AM Atul Kumar <akumar14871@gmail.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&...;
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
<#m_-5414522580965465877_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
@ 2020-11-18 09:44   ` Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
  2020-11-18 10:00     ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  0 siblings, 2 replies; 19+ messages in thread

From: Ron @ 2020-11-18 09:44 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 11/18/20 3:41 AM, Olivier Gautherot wrote:
> Hi Atul,
>
> On Wed, Nov 18, 2020 at 9:33 AM Atul Kumar <akumar14871@gmail.com 
> <mailto:akumar14871@gmail.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:
>
[snip]
>
>     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.

No matter how long it takes, this is an excellent argument for partitioning 
Very Large Tables: many maintenance tasks are made *much* easier.



-- 
Angular momentum makes the world go 'round.

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
@ 2020-11-18 09:57     ` Thomas Kellerer <shammat@gmx.net>
  2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
  1 sibling, 1 reply; 19+ messages in thread

From: Thomas Kellerer @ 2020-11-18 09:57 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Ron schrieb am 18.11.2020 um 10:44:
> No matter how long it takes, this is an excellent argument for
> partitioning Very Large Tables: many maintenance tasks are made
> *much* easier.

The problem is, you can't partition every table as long as Postgres
does not support a primary key that is independent of the partitioning key
(i.e. until it has "global indexes" as they are called in Oracle)

Thomas





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
@ 2020-11-18 12:02       ` Laurenz Albe <laurenz.albe@cybertec.at>
  2020-11-18 13:56         ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
  2020-11-18 16:45         ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  0 siblings, 2 replies; 19+ messages in thread

From: Laurenz Albe @ 2020-11-18 12:02 UTC (permalink / raw)
  To: Thomas Kellerer <shammat@gmx.net>; pgsql-general@lists.postgresql.org

On Wed, 2020-11-18 at 10:57 +0100, Thomas Kellerer wrote:
> > No matter how long it takes, this is an excellent argument for
> > partitioning Very Large Tables: many maintenance tasks are made
> > *much* easier.
> 
> The problem is, you can't partition every table as long as Postgres
> does not support a primary key that is independent of the partitioning key
> (i.e. until it has "global indexes" as they are called in Oracle)

I personally hope that we will never have global indexes.
I am not looking forward to helping customers with the problems that
they create (long duration of ATTACH/DETACH PARTITION, index fragmentation).

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
  2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-11-18 13:56         ` Paul Förster <paul.foerster@gmail.com>
  2020-11-18 14:30           ` Re: vacuum vs vacuum full Ravi Krishna <srkrishna@yahoo.com>
  1 sibling, 1 reply; 19+ messages in thread

From: Paul Förster @ 2020-11-18 13:56 UTC (permalink / raw)
  To: Cybertec Schönig & Schönig GmbH <laurenz.albe@cybertec.at>; +Cc: Thomas Kellerer <shammat@gmx.net>; pgsql-general@lists.postgresql.org

Hi Laurenz,

> On 18. Nov, 2020, at 13:02, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> 
> I personally hope that we will never have global indexes.
> I am not looking forward to helping customers with the problems that
> they create (long duration of ATTACH/DETACH PARTITION, index fragmentation).

+1.

Experience shows that global index in Oracle lead to problems when dropping a partition. rebuilding an index, or other such nice administrative stuff, often leading to unnecessarily long downtimes.

Cheers,
Paul




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
  2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
  2020-11-18 13:56         ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
@ 2020-11-18 14:30           ` Ravi Krishna <srkrishna@yahoo.com>
  2020-11-18 14:59             ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
  0 siblings, 1 reply; 19+ messages in thread

From: Ravi Krishna @ 2020-11-18 14:30 UTC (permalink / raw)
  To: Paul Förster <paul.foerster@gmail.com>; +Cc: Cybertec Schönig & Schönig GmbH <laurenz.albe@cybertec.at>; Thomas Kellerer <shammat@gmx.net>; PG List <pgsql-general@lists.postgresql.org>

> 
> Experience shows that global index in Oracle lead to problems when dropping a partition. rebuilding an index, or other such nice administrative stuff, often leading to unnecessarily long downtimes.
> 
> 

I think Oracle fixed it later by allowing asynchronous update of global index after the detachment of partition.

ALTER TABLE TABLE_NAME DROP PARTITION PARTITION_NAME UPDATE INDEXES;

will immediately start maintenance of global index by cleaning it up asynchronously, while the index is marked valid and can be used by the applications.

DB2 also has the same feature for a long time and it works fine.

I am sure there are genuine use cases of global indexes.

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
  2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
  2020-11-18 13:56         ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
  2020-11-18 14:30           ` Re: vacuum vs vacuum full Ravi Krishna <srkrishna@yahoo.com>
@ 2020-11-18 14:59             ` Paul Förster <paul.foerster@gmail.com>
  0 siblings, 0 replies; 19+ messages in thread

From: Paul Förster @ 2020-11-18 14:59 UTC (permalink / raw)
  To: Ravi Krishna <srkrishna@yahoo.com>; +Cc: Cybertec Schönig & Schönig GmbH <laurenz.albe@cybertec.at>; Thomas Kellerer <shammat@gmx.net>; PG List <pgsql-general@lists.postgresql.org>

Hi Ravi,

> On 18. Nov, 2020, at 15:30, Ravi Krishna <srkrishna@yahoo.com> wrote:
> 
> ALTER TABLE TABLE_NAME DROP PARTITION PARTITION_NAME UPDATE INDEXES;

IIRC the statement is

alter table <table> drop partition <partition> update *GLOBAL* indexes;

But we experienced big problems in the past which is why we changed all to local indexes. The situation may have improved in the last few years but we will not change back again. :-) Why should we?

Cheers,
Paul




^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
  2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
  2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-11-18 16:45         ` Ron <ronljohnsonjr@gmail.com>
  1 sibling, 0 replies; 19+ messages in thread

From: Ron @ 2020-11-18 16:45 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 11/18/20 6:02 AM, Laurenz Albe wrote:
> On Wed, 2020-11-18 at 10:57 +0100, Thomas Kellerer wrote:
>>> No matter how long it takes, this is an excellent argument for
>>> partitioning Very Large Tables: many maintenance tasks are made
>>> *much* easier.
>> The problem is, you can't partition every table as long as Postgres
>> does not support a primary key that is independent of the partitioning key
>> (i.e. until it has "global indexes" as they are called in Oracle)
> I personally hope that we will never have global indexes.
> I am not looking forward to helping customers with the problems that
> they create (long duration of ATTACH/DETACH PARTITION, index fragmentation).

I've been using what Oracle calls "global indexes" for 20 years. They're 
super useful when -- for example -- you want to partition a transaction 
table by a date field, while the PK is synthetic.

Up until about two years ago, I purged old data every six months. (Then it 
was migrated from the legacy RDBMS to Oracle.)

Yes, you've got to drop and rebuild the indices, but that's a small price to 
pay for the simplicity of archiving (especially when the indices are built 
in parallel).

-- 
Angular momentum makes the world go 'round.





^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
  2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
  2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
@ 2020-11-18 10:00     ` Olivier Gautherot <ogautherot@gautherot.net>
  1 sibling, 0 replies; 19+ messages in thread

From: Olivier Gautherot @ 2020-11-18 10:00 UTC (permalink / raw)
  To: Ron <ronljohnsonjr@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

On Wed, Nov 18, 2020 at 10:45 AM Ron <ronljohnsonjr@gmail.com> wrote:

> On 11/18/20 3:41 AM, Olivier Gautherot wrote:
>
> Hi Atul,
>
> On Wed, Nov 18, 2020 at 9:33 AM Atul Kumar <akumar14871@gmail.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:
>>
> [snip]
>
>
>
> 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.
>
>
> No matter how long it takes, this is an excellent argument for
> partitioning Very Large Tables: many maintenance tasks are made *much*
> easier.
>

I can only agree with this comment. The main issue I see is the available
disk space, as the partitioning process will include copying the whole
table.

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

^ permalink  raw  reply  [nested|flat] 19+ messages in thread

* Re: vacuum vs vacuum full
  2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
@ 2020-11-18 15:11 ` David G. Johnston <david.g.johnston@gmail.com>
  2 siblings, 0 replies; 19+ messages in thread

From: David G. Johnston @ 2020-11-18 15:11 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general

On Wed, Nov 18, 2020 at 1:33 AM Atul Kumar <akumar14871@gmail.com> wrote:

> Hi,
>
> We have a table of 3113GB, and we are planning to vacuum it in non
>

Just making sure that isn't a typo (repeated 1s)...

business hours i.e. 12AM to 4AM, So my queries are:
>
> 1. What should be perform on the table Vacuum or Vacuum full ?
>

You should be vacuuming that table constantly, so why is the particular
vacuum special?  What are the "last vacuum" related statistics for this
table?

There is "vacuum" and there is "rebuilding the whole table from scratch",
the later of which is unfortunately named "vacuum full".

If you haven't started learning/thinking about it yet you should try and
get an understanding around where your system is in the process of
requiring an anti-wraparound vacuum.  Or, more generally, using "vacuum
freeze".

David J.

^ permalink  raw  reply  [nested|flat] 19+ messages in thread


end of thread, other threads:[~2020-11-18 16:45 UTC | newest]

Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-08-05 06:04 Vacuum Vs Vacuum Full Robert Shaw <redsmurfau@msn.com>
2008-08-05 13:20 ` Adrian Klaver <aklaver@comcast.net>
2008-08-05 15:21   ` Matthew T. O'Connor <matthew@zeut.net>
2008-08-05 15:23     ` Robert Shaw <redsmurfau@msn.com>
2008-08-05 16:36     ` Tom Lane <tgl@sss.pgh.pa.us>
2008-08-05 16:54       ` Matthew T. O'Connor <matthew@zeut.net>
2008-08-05 17:15         ` Tom Lane <tgl@sss.pgh.pa.us>
2020-11-18 08:33 vacuum vs vacuum full Atul Kumar <akumar14871@gmail.com>
2020-11-18 09:38 ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
2020-11-18 09:41 ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
2020-11-18 09:44   ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
2020-11-18 09:57     ` Re: vacuum vs vacuum full Thomas Kellerer <shammat@gmx.net>
2020-11-18 12:02       ` Re: vacuum vs vacuum full Laurenz Albe <laurenz.albe@cybertec.at>
2020-11-18 13:56         ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
2020-11-18 14:30           ` Re: vacuum vs vacuum full Ravi Krishna <srkrishna@yahoo.com>
2020-11-18 14:59             ` Re: vacuum vs vacuum full Paul Förster <paul.foerster@gmail.com>
2020-11-18 16:45         ` Re: vacuum vs vacuum full Ron <ronljohnsonjr@gmail.com>
2020-11-18 10:00     ` Re: vacuum vs vacuum full Olivier Gautherot <ogautherot@gautherot.net>
2020-11-18 15:11 ` Re: vacuum vs vacuum full David G. Johnston <david.g.johnston@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox