pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Wenjun Che <wenjun@openfin.co>
To: pgsql-general@lists.postgresql.org
Subject: Re: Question on full vacuum clearing waste space
Date: Sun, 7 Jun 2020 09:08:25 -0700
Message-ID: <a56af5bd-ada4-9254-84ef-58c5c3943655@aklaver.com> (raw)
In-Reply-To: <CACYkyiTG90jbA5mhE=auBoq_-gBZjsz2a_t9wJAomzCjb6L9NQ@mail.gmail.com>
References: <CACYkyiQ7b2-O-F_=jBp=4mDNUxG8S+xPs7SQ6Co3ph5R8HGSBg@mail.gmail.com>
	<CABZeWdzy4E0Oy847qLC=YBsL1XshHkyAP24h3Xt06fvBhRJAuA@mail.gmail.com>
	<CACYkyiTG90jbA5mhE=auBoq_-gBZjsz2a_t9wJAomzCjb6L9NQ@mail.gmail.com>

On 6/7/20 6:06 AM, Wenjun Che wrote:
> Thank you for the quick response.
> 
> I ran the script from 
> https://wiki.postgresql.org/wiki/Show_database_bloat, which shows 
> "app_event_users" table has 3751936 as wastedbytes.

https://bucardo.org/check_postgres/check_postgres.pl.html#bloat

"Please note that the values computed by this action are not precise, 
and should be used as a guideline only. Great effort was made to 
estimate the correct size of a table, but in the end it is only an 
estimate. The correct index size is even more of a guess than the 
correct table size, but both should give a rough idea of how bloated 
things are."

> 
> On Sun, Jun 7, 2020 at 12:32 AM Mohamed Wael Khobalatte 
> <mkhobalatte@grubhub.com <mailto:mkhobalatte@grubhub.com>> wrote:
> 
> 
>     On Sat, Jun 6, 2020 at 11:24 PM Wenjun Che <wenjun@openfin.co
>     <mailto:wenjun@openfin.co>> wrote:
> 
>         Hi
> 
>         I am testing full vacuum with pg 10.10 on AWS RDS.  I noticed
>         for some tables, the number of waste bytes stays at a few MB
>         after I run full vacuum.  I double-checked that there are no
>         long running transactions, no orphaned prepared transactions and
>         no abandoned replication slots.
> 
>         Here is output from full vacuum for one of the tables:
> 
>         VACUUM(FULL, ANALYZE, VERBOSE) app_events_users
>         vacuuming "app_events_users"
>         "app_events_users": found 0 removable, 1198881 nonremovable row
>         versions in 13369 pages
>         analyzing "licensing.app_events_users"
>         "app_events_users": scanned 13369 of 13369 pages, containing
>         1198881 live rows and 0 dead rows; 30000 rows in sample, 1198881
>         estimated total rows
> 
>         What else can prevent full vacuum from reclaiming all waste space ?
> 
>         Thank you 
> 
> 
>     What "waste query" are you running? Those tend to be estimates only.
>     Vacuum Full clearly did its job from that log you shared.
> 
> 
> 
> -- 
> Wenjun Che
> VP of Engineering | OpenFin
> wenjun@openfin.co <mailto:wenjun@openfin.co>
> 
> *Move Fast.  Break Nothing.*
> www.openfin.co <http://www.openfin.co; | @openfintech


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (4+ messages)

Message-ID: <a56af5bd-ada4-9254-84ef-58c5c3943655@aklaver.com>
Permalink:  ../a56af5bd-ada4-9254-84ef-58c5c3943655@aklaver.com/
Also on:    postgresql.org/message-id/a56af5bd-ada4-9254-84ef-58c5c3943655@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, wenjun@openfin.co
  Subject: Re: Question on full vacuum clearing waste space
  In-Reply-To: <a56af5bd-ada4-9254-84ef-58c5c3943655@aklaver.com>
  References: <CACYkyiQ7b2-O-F_=jBp=4mDNUxG8S+xPs7SQ6Co3ph5R8HGSBg@mail.gmail.com> <CABZeWdzy4E0Oy847qLC=YBsL1XshHkyAP24h3Xt06fvBhRJAuA@mail.gmail.com> <CACYkyiTG90jbA5mhE=auBoq_-gBZjsz2a_t9wJAomzCjb6L9NQ@mail.gmail.com> <a56af5bd-ada4-9254-84ef-58c5c3943655@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