pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rui DeSousa <rui.desousa@icloud.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-admin@postgresql.org
Subject: Re: Vacuum not removing dead tuples
Date: Wed, 15 Nov 2017 11:44:20 -0500
Message-ID: <BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.com> (raw)
In-Reply-To: <1510740365.2424.22.camel@cybertec.at>
References: <7D8ED7AF-E189-4FA2-BB6D-FC9E8A127E28@icloud.com>
	<1510740365.2424.22.camel@cybertec.at>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Thanks Laurenz, 

A replication slot was my issue.  Much appreciated for the insight.

Thanks,
Rui

> On Nov 15, 2017, at 5:06 AM, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> 
> Rui DeSousa wrote:
>> Is there a reason vacuum will not remove dead tuples other than the usual suspects?
>> There are no two phase transactions and even after a restoring the database
>> from binary backup with nothing connect to the restored instance;
>> vacuum still does not remove the dead tuples.
> 
> There are three possibilities:
> 
> 1) Active transactions:
> 
>   SELECT backend_xmin, xact_start, datname, pid, query
>   FROM pg_stat_activity
>   WHERE state <> 'idle'
>   ORDER BY xact_start;
> 
> 2) Prepared transactions:
> 
>   SELECT xid, prepared
>   FROM pg_prepared_xacts;
> 
> 3) Lagging replication slots:
> 
>   SELECT xmin, slot_name, active, active_pid
>   FROM pg_replication_slots;
> 
> The "xid" columns will tell you which tuples VACUUM can
> remove: Any tuple with "xmax" less than this are fair game.
> 
> Yours,
> Laurenz Albe



-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (3+ messages)

Message-ID: <BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.com>
Permalink:  ../BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.com/
Also on:    postgresql.org/message-id/BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.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-admin@postgresql.org
  Cc: rui.desousa@icloud.com, laurenz.albe@cybertec.at
  Subject: Re: Vacuum not removing dead tuples
  In-Reply-To: <BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.com>
  References: <7D8ED7AF-E189-4FA2-BB6D-FC9E8A127E28@icloud.com> <1510740365.2424.22.camel@cybertec.at> <BC6828D2-7D68-4EDA-AAE1-AEB1FCF1BA2D@icloud.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