Re: questions about a table's row estimates

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: questions about a table's row estimates
Date: 2010-02-11 17:26:17
Message-ID: FB23ED59-D84C-4C0C-8284-3FD9B065324A@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Feb 10, 2010, at 10:28 PM, Greg Smith wrote:

> 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

Say what? It's not documented terrible well (http://www.postgresql.org/docs/8.4/interactive/monitoring-stats.html is the best I can find) but I thought n_live_tup was basically the number of tuples visible to a new transaction. If my assumption is wrong, that might explain things.

And unfortunately, Tom, we're not resetting stats counters. :(

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-02-11 17:28:30 Re: pg_dump superflous warning message
Previous Message Joshua D. Drake 2010-02-11 17:24:55 Re: [HACKERS] Bug on pg_lesslog