I need a clarification on 'n_live_tup' column available in the predefined table 'pg_stat_user_tables'.
I have two tables having one to one relationship, i.e., each row in TableA has its corresponding row in the TableB . Upon inserting or updating a row in Table A , trigger defined on Table A will make sure of inserting / updating a row in Table B.I also confirm that i have same number of rows in both the tables.
But when ran the below SQL statement i could see a huge difference of 'n_live_tup' value.
select relname , n_live_tup,n_dead_tup from pg_stat_user_tables ;
n_live_tup -Table A(parent table) shows '159037' , TableB is showing '1428582' the value of n_dead_tup is zero for both the tables.
Can some one help me out by explaining why this is happening. Am i missing any basic theory here ( am new to postgres).
Regards,Harika


Check Solution