pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: M Tarkeshwar Rao <m.tarkeshwar.rao@ericsson.com>
To: Michael Lewis <mlewis@entrata.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Cc: Ankit Sharma <ankit.sharma10@globallogic.com>
Cc: Atul Parashar <atul.parashar@ericsson.com>
Subject: Re: Autovacuum not functioning for large tables but it is working for few other small tables.
Date: Fri, 19 Feb 2021 14:29:03 +0100
Message-ID: <96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at> (raw)
In-Reply-To: <AM6PR0702MB3783DA774AEA4DD4470489AFAE849@AM6PR0702MB3783.eurprd07.prod.outlook.com>
References: <AM6PR0702MB3783F4CFF71E3FD27E9C9AC0AEC50@AM6PR0702MB3783.eurprd07.prod.outlook.com>
	<AM6PR0702MB3783AE08F338E43BE1D82914AEC50@AM6PR0702MB3783.eurprd07.prod.outlook.com>
	<cdfe8ced-45b9-2607-e1e5-98ee45afd694@enterprisedb.com>
	<AM6PR0702MB378362D2014D944176AFC807AEAE0@AM6PR0702MB3783.eurprd07.prod.outlook.com>
	<CAHOFxGpokCR7rNB4CUkDcLGR1OXXs=RW0Wc1mGb6fwqca45L-w@mail.gmail.com>
	<AM6PR0702MB37837C997A853A097213BED5AEAC0@AM6PR0702MB3783.eurprd07.prod.outlook.com>
	<AM6PR0702MB3783DA774AEA4DD4470489AFAE849@AM6PR0702MB3783.eurprd07.prod.outlook.com>

On Fri, 2021-02-19 at 10:51 +0000, M Tarkeshwar Rao wrote:
> Please find the Vacuum(verbose) output. Can you please suggest what is the reason?
> How can we avoid these scenarios?
> 
> The customer tried to run the VACUUM(verbose) last night, but it was running
>  continuously for 5 hours without any visible progress. So they had to abort it
>  as it was going to exhaust their maintenance window.
> 
> db_Server14=# VACUUM (VERBOSE) audittraillogentry;
> INFO:  vacuuming "mmsuper.audittraillogentry"
> INFO:  scanned index "audittraillogentry_pkey" to remove 11184539 row versions
> DETAIL:  CPU 25.24s/49.11u sec elapsed 81.33 sec
> INFO:  scanned index "audit_intime_index" to remove 11184539 row versions
> DETAIL:  CPU 23.27s/59.28u sec elapsed 88.63 sec
> INFO:  scanned index "audit_outtime_index" to remove 11184539 row versions
> DETAIL:  CPU 27.02s/55.10u sec elapsed 92.04 sec
> INFO:  scanned index "audit_sourceid_index" to remove 11184539 row versions
> DETAIL:  CPU 110.81s/72.29u sec elapsed 260.71 sec
> [and so on, the same 6 indexes are repeatedly scanned]

PostgreSQL performs VACUUM in batches of "maintenance_work_mem" size
of tuple identifiers.  If that parameter is small, the indexes have
to be scanned often.

Try increasing "maintenance_work_mem" to 1GB (if you have enough RAM),
that will make it faster.

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






view thread (11+ messages)

Message-ID: <96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at>
Permalink:  ../96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at/
Also on:    postgresql.org/message-id/96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, m.tarkeshwar.rao@ericsson.com, mlewis@entrata.com, pgsql-performance@postgresql.org, ankit.sharma10@globallogic.com, atul.parashar@ericsson.com
  Subject: Re: Autovacuum not functioning for large tables but it is working for few other small tables.
  In-Reply-To: <96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at>
  References: <AM6PR0702MB3783F4CFF71E3FD27E9C9AC0AEC50@AM6PR0702MB3783.eurprd07.prod.outlook.com> <AM6PR0702MB3783AE08F338E43BE1D82914AEC50@AM6PR0702MB3783.eurprd07.prod.outlook.com> <cdfe8ced-45b9-2607-e1e5-98ee45afd694@enterprisedb.com> <AM6PR0702MB378362D2014D944176AFC807AEAE0@AM6PR0702MB3783.eurprd07.prod.outlook.com> <CAHOFxGpokCR7rNB4CUkDcLGR1OXXs=RW0Wc1mGb6fwqca45L-w@mail.gmail.com> <AM6PR0702MB37837C997A853A097213BED5AEAC0@AM6PR0702MB3783.eurprd07.prod.outlook.com> <AM6PR0702MB3783DA774AEA4DD4470489AFAE849@AM6PR0702MB3783.eurprd07.prod.outlook.com> <96ac94b7d5f5be3e03e94f21253ae4220c01f0ee.camel@cybertec.at>

* 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