pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Virendra Kumar <viru_7683@yahoo.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
To: Kevin Brannen <KBrannen@efji.com>
Subject: Re: how to slow down parts of Pg
Date: Tue, 21 Apr 2020 15:54:09 -0700
Message-ID: <655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.com> (raw)
In-Reply-To: <932472069.554849.1587504761819@mail.yahoo.com>
References: <SA0PR19MB425585C98C339C35A4A5343AA4D50@SA0PR19MB4255.namprd19.prod.outlook.com>
	<CAHOFxGo_+iyx-MOqmF6gfJNmdfM=dTBY5EcO4RjEhGxuLs8azQ@mail.gmail.com>
	<SA0PR19MB425511C97C8C60567FA9ECDAA4D50@SA0PR19MB4255.namprd19.prod.outlook.com>
	<CAHDg04vgBHOBA3HW_=24XUjsO8NMrAJx-BF72fKmbnG=cCOJOg@mail.gmail.com>
	<SA0PR19MB42556F2C05E6DF9912543645A4D50@SA0PR19MB4255.namprd19.prod.outlook.com>
	<932472069.554849.1587504761819@mail.yahoo.com>

On 4/21/20 2:32 PM, Virendra Kumar wrote:
> Autovacuum does takes care of dead tuples and return space to table's 
> allocated size and can be re-used by fresh incoming rows or any updates.
> 
> Index bloat is still not being taken care of by autovacuum process. You 
> should use pg_repack to do index rebuild. Keep in mind that pg_repack 
> requires double the space of indexes, since there will be two indexes 
> existing during rebuild processes.

You sure about that? On Postgres 12:

--2020-04-21 15:47:27.452 PDT-0DEBUG:  plant1: vac: 5154 (threshold 
1081), anl: 5154 (threshold 565)
--2020-04-21 15:47:27.452 PDT-0DEBUG:  autovac_balance_cost(pid=18701 
db=25092, rel=26497, dobalance=yes cost_limit=200, cost_limit_base=200, 
cost_delay=2)
--2020-04-21 15:47:27.452 PDT-0DEBUG:  CommitTransaction(1) name: 
unnamed; blockState: STARTED; state: INPROGRESS, xid/subid/cid: 0/1/0
--2020-04-21 15:47:27.452 PDT-0DEBUG:  StartTransaction(1) name: 
unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
--2020-04-21 15:47:27.452 PDT-0DEBUG:  vacuuming "public.plant1"
--2020-04-21 15:47:27.504 PDT-0DEBUG:  scanned index "p_no_pkey" to 
remove 5114 row versions
--2020-04-21 15:47:27.504 PDT-0DETAIL:  CPU: user: 0.00 s, system: 0.00 
s, elapsed: 0.00 s
--2020-04-21 15:47:27.514 PDT-0DEBUG:  scanned index "common_idx" to 
remove 5114 row versions
--2020-04-21 15:47:27.514 PDT-0DETAIL:  CPU: user: 0.00 s, system: 0.00 
s, elapsed: 0.01 s
--2020-04-21 15:47:27.515 PDT-0DEBUG:  scanned index "genus_idx" to 
remove 5114 row versions
--2020-04-21 15:47:27.515 PDT-0DETAIL:  CPU: user: 0.00 s, system: 0.00 
s, elapsed: 0.00 s
--2020-04-21 15:47:27.517 PDT-0DEBUG:  "plant1": removed 5114 row 
versions in 121 pages
--2020-04-21 15:47:27.517 PDT-0DETAIL:  CPU: user: 0.00 s, system: 0.00 
s, elapsed: 0.00 s
--2020-04-21 15:47:27.517 PDT-0DEBUG:  index "p_no_pkey" now contains 
5154 row versions in 31 pages
--2020-04-21 15:47:27.517 PDT-0DETAIL:  5114 index row versions were 
removed.
         0 index pages have been deleted, 0 are currently reusable.
         CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
--2020-04-21 15:47:27.517 PDT-0DEBUG:  index "common_idx" now contains 
5154 row versions in 60 pages
--2020-04-21 15:47:27.517 PDT-0DETAIL:  5114 index row versions were 
removed.
         0 index pages have been deleted, 0 are currently reusable.
         CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
--2020-04-21 15:47:27.517 PDT-0DEBUG:  index "genus_idx" now contains 
5154 row versions in 47 pages
--2020-04-21 15:47:27.517 PDT-0DETAIL:  5114 index row versions were 
removed.
         0 index pages have been deleted, 0 are currently reusable.
         CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s.
--2020-04-21 15:47:27.518 PDT-0DEBUG:  "plant1": found 5154 removable, 
5154 nonremovable row versions in 195 out of 195 pages
--2020-04-21 15:47:27.518 PDT-0DETAIL:  0 dead row versions cannot be 
removed yet, oldest xmin: 9715
         There were 256 unused item identifiers.
         Skipped 0 pages due to buffer pins, 0 frozen pages.
         0 pages are entirely empty.
         CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.06 s.
--2020-04-21 15:47:27.518 PDT-0LOG:  automatic vacuum of table 
"production.public.plant1": index scans: 1
         pages: 0 removed, 195 remain, 0 skipped due to pins, 0 skipped 
frozen
         tuples: 5154 removed, 5154 remain, 0 are dead but not yet 
removable, oldest xmin: 9715
         buffer usage: 753 hits, 0 misses, 255 dirtied
         avg read rate: 0.000 MB/s, avg write rate: 30.586 MB/s
         system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.06 s



> 
> Regards,
> Virendra Kumar
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (20+ messages)  latest in thread

Message-ID: <655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.com>
Permalink:  ../655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.com/
Also on:    postgresql.org/message-id/655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.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 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: adrian.klaver@aklaver.com, viru_7683@yahoo.com, KBrannen@efji.com
  Subject: Re: how to slow down parts of Pg
  In-Reply-To: <655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.com>
  References: <SA0PR19MB425585C98C339C35A4A5343AA4D50@SA0PR19MB4255.namprd19.prod.outlook.com> <CAHOFxGo_+iyx-MOqmF6gfJNmdfM=dTBY5EcO4RjEhGxuLs8azQ@mail.gmail.com> <SA0PR19MB425511C97C8C60567FA9ECDAA4D50@SA0PR19MB4255.namprd19.prod.outlook.com> <CAHDg04vgBHOBA3HW_=24XUjsO8NMrAJx-BF72fKmbnG=cCOJOg@mail.gmail.com> <SA0PR19MB42556F2C05E6DF9912543645A4D50@SA0PR19MB4255.namprd19.prod.outlook.com> <932472069.554849.1587504761819@mail.yahoo.com> <655239f9-7ece-8f18-816b-68ed421d34e2@aklaver.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