Where does vacuum FULL write temp-files?

Started by Andreas Joseph Kroghalmost 11 years ago5 messagesgeneral
Jump to latest
#1Andreas Joseph Krogh
andreas@visena.com

Hi all.   I'm planning to vacuum FULL a pg_largeobject relation (after
vacuumlo'ing it). The relation is 300GB large so I'm concerned the operation
will write full my pg_xlog directory which is on a 200GB (net) RAID1 SSD.  
Where does vacuum FULL rewrite to, does it use pg_xlog or some other directory?
  Thanks.   -- Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909
56 963 andreas@visena.com <mailto:andreas@visena.com> www.visena.com
<https://www.visena.com&gt; <https://www.visena.com&gt;

#2Venkata B Nagothi
nag1010@gmail.com
In reply to: Andreas Joseph Krogh (#1)
Re: Where does vacuum FULL write temp-files?

I'm planning to vacuum FULL a pg_largeobject relation (after vacuumlo'ing
it). The relation is 300GB large so I'm concerned the operation will write
full my pg_xlog directory which is on a 200GB (net) RAID1 SSD.

Where does vacuum FULL rewrite to, does it use pg_xlog or some other
directory?

Which version of PostgreSQL is this ?

If i got your question correctly, VACUUM FULL would rewrite the data to a
new data file associated with that particular relation (Table) in the
"$PGDATA/base" directory. This needs an extra disk space at the OS level
(this is not related to pg_xlog directory).

As VACUUMING is a data change operation, "pg_xlog" will also have only the
WAL data (modifications) written at the time of VACUUMING.

http://www.postgresql.org/docs/9.4/static/sql-vacuum.html

Regards,
Venkata Balaji N

Fujitsu Australia

#3Andreas Joseph Krogh
andreas@visena.com
In reply to: Venkata B Nagothi (#2)
Re: Where does vacuum FULL write temp-files?

På onsdag 15. april 2015 kl. 04:34:31, skrev Venkata Balaji N <nag1010@gmail.com
<mailto:nag1010@gmail.com>>:   I'm planning to vacuum FULL a pg_largeobject
relation (after vacuumlo'ing it). The relation is 300GB large so I'm concerned
the operation will write full my pg_xlog directory which is on a 200GB (net)
RAID1 SSD.   Where does vacuum FULL rewrite to, does it use pg_xlog or some
other directory?   Which version of PostgreSQL is this ?
  If i got your question correctly, VACUUM FULL would rewrite the data to a
new data file associated with that particular relation (Table) in the
"$PGDATA/base" directory. This needs an extra disk space at the OS level (this
is not related to pg_xlog directory).

As VACUUMING is a data change operation, "pg_xlog" will also have only the
WAL data (modifications) written at the time of VACUUMING.

http://www.postgresql.org/docs/9.4/static/sql-vacuum.html
<http://www.postgresql.org/docs/9.4/static/sql-vacuum.html&gt;   This is PG-9.3  
So I understand that VACUUM FULL writes the new table to the same tablespace as
the original table (also for system-catalogs like pg_largeobject), and doesn't
use any temp-space outside the location of that tablespace?   Thanks.   --
Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56 963
andreas@visena.com <mailto:andreas@visena.com> www.visena.com
<https://www.visena.com&gt; <https://www.visena.com&gt;  

#4Guillaume Lelarge
guillaume@lelarge.info
In reply to: Andreas Joseph Krogh (#3)
Re: Where does vacuum FULL write temp-files?

2015-04-15 10:46 GMT+02:00 Andreas Joseph Krogh <andreas@visena.com>:

På onsdag 15. april 2015 kl. 04:34:31, skrev Venkata Balaji N <
nag1010@gmail.com>:

I'm planning to vacuum FULL a pg_largeobject relation (after vacuumlo'ing
it). The relation is 300GB large so I'm concerned the operation will write
full my pg_xlog directory which is on a 200GB (net) RAID1 SSD.

Where does vacuum FULL rewrite to, does it use pg_xlog or some other
directory?

Which version of PostgreSQL is this ?

If i got your question correctly, VACUUM FULL would rewrite the data to a
new data file associated with that particular relation (Table) in the
"$PGDATA/base" directory. This needs an extra disk space at the OS level
(this is not related to pg_xlog directory).

As VACUUMING is a data change operation, "pg_xlog" will also have only the
WAL data (modifications) written at the time of VACUUMING.

http://www.postgresql.org/docs/9.4/static/sql-vacuum.html

This is PG-9.3

So I understand that VACUUM FULL writes the new table to the same
tablespace as the original table (also for system-catalogs like
pg_largeobject), and doesn't use any temp-space outside the location of
that tablespace?

You're right.

--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com

#5Andreas Joseph Krogh
andreas@visena.com
In reply to: Guillaume Lelarge (#4)
Re: Where does vacuum FULL write temp-files?

På fredag 17. april 2015 kl. 00:05:47, skrev Guillaume Lelarge <
guillaume@lelarge.info <mailto:guillaume@lelarge.info>>: 2015-04-15 10:46
GMT+02:00 Andreas Joseph Krogh<andreas@visena.com <mailto:andreas@visena.com>>:
På onsdag 15. april 2015 kl. 04:34:31, skrev Venkata Balaji N <nag1010@gmail.com
<mailto:nag1010@gmail.com>>:   I'm planning to vacuum FULL a pg_largeobject
relation (after vacuumlo'ing it). The relation is 300GB large so I'm concerned
the operation will write full my pg_xlog directory which is on a 200GB (net)
RAID1 SSD.   Where does vacuum FULL rewrite to, does it use pg_xlog or some
other directory?   Which version of PostgreSQL is this ?
  If i got your question correctly, VACUUM FULL would rewrite the data to a
new data file associated with that particular relation (Table) in the
"$PGDATA/base" directory. This needs an extra disk space at the OS level (this
is not related to pg_xlog directory).

As VACUUMING is a data change operation, "pg_xlog" will also have only the
WAL data (modifications) written at the time of VACUUMING.

http://www.postgresql.org/docs/9.4/static/sql-vacuum.html
<http://www.postgresql.org/docs/9.4/static/sql-vacuum.html&gt;   This is PG-9.3  
So I understand that VACUUM FULL writes the new table to the same tablespace as
the original table (also for system-catalogs like pg_largeobject), and doesn't
use any temp-space outside the location of that tablespace?     You're right.  
Thanks.   -- Andreas Joseph Krogh CTO / Partner - Visena AS Mobile: +47 909 56
963 andreas@visena.com <mailto:andreas@visena.com> www.visena.com
<https://www.visena.com&gt; <https://www.visena.com&gt;