Re: questions about a table's row estimates

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Ben Chobot <bench(at)silentmedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: questions about a table's row estimates
Date: 2010-02-11 06:28:10
Message-ID: 4B73A37A.4010906@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ben Chobot wrote:
> I'm looking at pg_stat_user_tables in 8.4.2, and I'm confused about n_live_tup. Shouldn't that be at least fairly close to (n_tup_ins - n_tup-del)? It doesn't seem to be, but I'm unclear why.
>
Insert 2000 tuples.
Delete 1000 tuples.
vacuum
Insert 1000 tuples. These go into the free space the deleted tuples used
to be in.
analyze

n_tup_ins=3000
n_tup_del=1000
n_live_tup=3000

If there's any delete/vacuum/reuse churn here, no reason the believe the
insert/delete and live counts will be close at all.

--
Greg Smith 2ndQuadrant Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-02-11 07:04:12 Re: questions about a table's row estimates
Previous Message Greg Smith 2010-02-11 06:20:25 Re: Memory Usage and OpenBSD