pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Benjamin Scherrey <scherrey@proteus-tech.com>
Cc: Hugh Ranalli <hugh@whtc.ca>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Perplexing, regular decline in performance
Date: Tue, 25 Jun 2019 11:01:06 -0500
Message-ID: <20190625160106.GD18602@telsasoft.com> (raw)
In-Reply-To: <CACo3ShijfteC03wGhsMwTOw16u39f9ameO=4RoQGz8b4SsQbvg@mail.gmail.com>
References: <CAAhbUMNdqFhdsoTKfE2wPp70+Zcrjs_Zcp7uh-6dnREZnVd5XA@mail.gmail.com>
	<CACo3ShijfteC03wGhsMwTOw16u39f9ameO=4RoQGz8b4SsQbvg@mail.gmail.com>

On Tue, Jun 25, 2019 at 10:55:22PM +0700, Benjamin Scherrey wrote:
> Have you done a VACUUM ANALYZE FULL on your database? This needs to be done
> periodically to inform the server of the statistics of how the data and
> relations are distributed across the database.

I think this is wrong.

VACUUM and ANALYZE are good, but normally happen automatically by autovacuum.

VACUUM FULL takes an exclusive lock on the table, and rewrites its data and
indices from scratch.  It's not normally necessary at all.  It's probably most
useful to recover from badly-bloated table if autovacuum didn't run often
enough, in which case the permanent solution is to change autovacuum settings
to be more aggressive.

Don't confuse with VACUUM FREEZE, which doesn't require exclusive lock, and
normally not necessary if autovacuum is working properly.

Justin





view thread (18+ messages)  latest in thread

Message-ID: <20190625160106.GD18602@telsasoft.com>
Permalink:  ../20190625160106.GD18602@telsasoft.com/
Also on:    postgresql.org/message-id/20190625160106.GD18602@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, scherrey@proteus-tech.com, hugh@whtc.ca, pgsql-performance@lists.postgresql.org
  Subject: Re: Perplexing, regular decline in performance
  In-Reply-To: <20190625160106.GD18602@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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