Re: live and dead tuples are zero on slave running on tmpfs

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Karthik Viswanathan <krthkv26(at)gmail(dot)com>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: live and dead tuples are zero on slave running on tmpfs
Date: 2015-08-20 02:19:49
Message-ID: CAJrrPGemRnMMh_eqKk_otLLfrshxQfDQrZqs+5veXi_RRi3aLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 20, 2015 at 12:55 AM, Karthik Viswanathan
<krthkv26(at)gmail(dot)com> wrote:
> Hello,
>
> I have a master slave (read replica) setup running pg 9.4.4. I'm
> trying to find the dead tuples out both the master and slave
>
> Here's what it looks like on master:
>
> # select relname ,n_live_tup ,n_dead_tup from pg_stat_user_tables;
> relname | n_live_tup | n_dead_tup
> ------------------+------------+------------
> test_52 | 4998366 | 0
> test_v2 | 25182728 | 4086591
> test_1mrows | 1000127 | 0
>
> That seems legit because I did an update to ~4million rows just before this.
>
> Here's what it looks on slave though
>
> #select relname ,n_live_tup ,n_dead_tup from pg_stat_user_tables;
> relname | n_live_tup | n_dead_tup
> ------------------+------------+------------
> test_52 | 0 | 0
> test_v2 | 0 | 0
> test_1mrows | 0 | 0
>
> the postgres data directory on the slave is configured to a tmpfs
> mounted store. Would this cause it to have zero live & dead tuples ?

Autovacuum process doesn't run on slave servers. This is the process
which updates the live and dead tuples. And also pg_stat_tmp files are
not copied from master to slave during backup.

Because of the above reasons, there are no stats available for the tables
in the slave server because of this reason it shows the 0 live and 0 dead
rows. This is expected.

Regards,
Hari Babu
Fujitsu Australia

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2015-08-20 03:50:48 Re: PostgreSQL customer list
Previous Message Scott Marlowe 2015-08-20 01:56:52 Re: PostgreSQL customer list