pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedvacuum full doubled database size
6+ messages / 5 participants
[nested] [flat]
* vacuum full doubled database size
@ 2020-03-13 13:41 Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-03-13 13:47 ` Re: vacuum full doubled database size Michael Loftis <mloftis@wgops.com>
2020-03-13 15:15 ` Re: vacuum full doubled database size Ron <ronljohnsonjr@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Zwettler Markus (OIZ) @ 2020-03-13 13:41 UTC (permalink / raw)
To: pgsql-general
We did a "vacuum full" on a database which had been interrupted by a network outage.
We found the database size doubled afterwards.
Autovacuum also found a lot of orphaned tables afterwards.
The ophan temp objects went away after a cluster restart while the db size remained doubled.
Any idea?
Postgres 9.6.17
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: vacuum full doubled database size
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
@ 2020-03-13 13:47 ` Michael Loftis <mloftis@wgops.com>
1 sibling, 0 replies; 6+ messages in thread
From: Michael Loftis @ 2020-03-13 13:47 UTC (permalink / raw)
To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; +Cc: pgsql-general
A vacuum full rebuilds the tables, so yeah if it didn’t successfully
complete I would expect a lot of dead data.
On Fri, Mar 13, 2020 at 07:41 Zwettler Markus (OIZ) <
Markus.Zwettler@zuerich.ch> wrote:
> We did a "vacuum full" on a database which had been interrupted by a
> network outage.
>
>
>
> We found the database size doubled afterwards.
>
>
>
> Autovacuum also found a lot of orphaned tables afterwards.
>
>
>
> The ophan temp objects went away after a cluster restart while the db size
> remained doubled.
>
>
>
> Any idea?
>
>
>
> Postgres 9.6.17
>
>
>
>
>
--
"Genius might be described as a supreme capacity for getting its possessors
into trouble of all kinds."
-- Samuel Butler
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: vacuum full doubled database size
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
@ 2020-03-13 15:15 ` Ron <ronljohnsonjr@gmail.com>
2020-03-13 15:32 ` Re: vacuum full doubled database size Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
1 sibling, 1 reply; 6+ messages in thread
From: Ron @ 2020-03-13 15:15 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
This is why I'd VACUUM FULL in a planned manner, one or two tables at a
time, and *locally* from crontab.
On 3/13/20 8:41 AM, Zwettler Markus (OIZ) wrote:
>
> We did a "vacuum full" on a database which had been interrupted by a
> network outage.
>
> We found the database size doubled afterwards.
>
> Autovacuum also found a lot of orphaned tables afterwards.
>
> The ophan temp objects went away after a cluster restart while the db size
> remained doubled.
>
> Any idea?
>
> Postgres 9.6.17
>
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: vacuum full doubled database size
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-03-13 15:15 ` Re: vacuum full doubled database size Ron <ronljohnsonjr@gmail.com>
@ 2020-03-13 15:32 ` Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
2020-03-13 16:01 ` RE: vacuum full doubled database size Kevin Brannen <KBrannen@efji.com>
2020-03-13 17:36 ` Re: vacuum full doubled database size Ron <ronljohnsonjr@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Fabio Ugo Venchiarutti @ 2020-03-13 15:32 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; pgsql-general@lists.postgresql.org
On 13/03/2020 15:15, Ron wrote:
> This is why I'd VACUUM FULL in a planned manner, one or two tables at a
> time, and *locally* from crontab.
That's not really viable on any remotely busy system: VACUUM FULL claims
exclusive table locks, causing queries to hang
(https://www.postgresql.org/docs/current/sql-vacuum.html#NOTES mentions
this too).
Tools like pg_repack can do some live shrinking.
I've also had some success at reclaiming space without large scale locks
by carefully crafting some atomic DELETE + INSERT in order to force
tuples from the tail end into gaps at lower CTIDs (physical page
address) that were made available by previous plain VACUUMs - regular
VACUUM will clip data files if all the tuples beyond a given offset are
dead.
>
> On 3/13/20 8:41 AM, Zwettler Markus (OIZ) wrote:
>>
>> We did a "vacuum full" on a database which had been interrupted by a
>> network outage.
>>
>> We found the database size doubled afterwards.
>>
>> Autovacuum also found a lot of orphaned tables afterwards.
>>
>> The ophan temp objects went away after a cluster restart while the db
>> size remained doubled.
>>
>> Any idea?
>>
>> Postgres 9.6.17
>>
>
> --
> Angular momentum makes the world go 'round.
--
Regards
Fabio Ugo Venchiarutti
OSPCFC Network Engineering Dpt.
Ocado Technology
--
Notice:
This email is confidential and may contain copyright material of
members of the Ocado Group. Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the members of the
Ocado Group.
If you are not the intended recipient, please notify us
immediately and delete all copies of this message. Please note that it is
your responsibility to scan this message for viruses.
References to the
"Ocado Group" are to Ocado Group plc (registered in England and Wales with
number 7098618) and its subsidiary undertakings (as that expression is
defined in the Companies Act 2006) from time to time. The registered office
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way,
Hatfield, Hertfordshire, AL10 9UL.
^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: vacuum full doubled database size
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-03-13 15:15 ` Re: vacuum full doubled database size Ron <ronljohnsonjr@gmail.com>
2020-03-13 15:32 ` Re: vacuum full doubled database size Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
@ 2020-03-13 16:01 ` Kevin Brannen <KBrannen@efji.com>
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Brannen @ 2020-03-13 16:01 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
>Fabio Ugo Venchiarutti wrote:
>On 13/03/2020 15:15, Ron wrote:
>> This is why I'd VACUUM FULL in a planned manner, one or two tables at
>> a time, and *locally* from crontab.
>
>That's not really viable on any remotely busy system: VACUUM FULL claims exclusive table locks, causing queries to hang (https://www.postgresql.org/docs/current/sql-vacuum.html#NOTES mentions this too).
>
>Tools like pg_repack can do some live shrinking.
To say "not really viable on any remotely busy system" is a pretty sweeping
statement. I think a better statement is that "for many busy systems, this could
be a real problem and to consider it carefully in light of your needs."
On our systems, we do this just fine, though the difference is probably the
level of busy. We have periods that are not as busy as others (1am). In addition,
most of our tables are fairly small'ish and a VACUUM FULL takes 30sec or
less, so it's not so bad. The vast majority of our data is in about a dozen
tables which are mostly used for reports by people in the daytime, so if they
lock for 5min each in the middle of the night on a weekend it's OK (and we only
do this once a quarter).
So this approach can work, but "it depends" and "YMMV" and all that jazz...which
I believe was what Ron was trying to point out with planning.
That being said, I've had "go check out pg_repack" on my to-do list for a while and
one day I will, but at the moment the above works for us.
Kevin
.
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: vacuum full doubled database size
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-03-13 15:15 ` Re: vacuum full doubled database size Ron <ronljohnsonjr@gmail.com>
2020-03-13 15:32 ` Re: vacuum full doubled database size Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
@ 2020-03-13 17:36 ` Ron <ronljohnsonjr@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Ron @ 2020-03-13 17:36 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 3/13/20 10:32 AM, Fabio Ugo Venchiarutti wrote:
> On 13/03/2020 15:15, Ron wrote:
>> This is why I'd VACUUM FULL in a planned manner, one or two tables at a
>> time, and *locally* from crontab.
>
> That's not really viable on any remotely busy system: VACUUM FULL claims
> exclusive table locks, causing queries to hang
> (https://www.postgresql.org/docs/current/sql-vacuum.html#NOTES mentions
> this too).
This is of course *if* I were to ever do a VACUUM FULL... :)
The point is that your mother's rule about not sticking a giant fork-full of
food into your mouth is also an excellent rule in IT.
--
Angular momentum makes the world go 'round.
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2020-03-13 17:36 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13 13:41 vacuum full doubled database size Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2020-03-13 13:47 ` Michael Loftis <mloftis@wgops.com>
2020-03-13 15:15 ` Ron <ronljohnsonjr@gmail.com>
2020-03-13 15:32 ` Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
2020-03-13 16:01 ` Kevin Brannen <KBrannen@efji.com>
2020-03-13 17:36 ` Ron <ronljohnsonjr@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