reltuples < # of rows

From: Eric Brown <eric(dot)brown(at)propel(dot)com>
To: Postgres help (E-mail) <pgsql-general(at)postgresql(dot)org>
Subject: reltuples < # of rows
Date: 2005-02-23 16:54:13
Message-ID: 8BC973E9-85BB-11D9-B2BE-000A95C7176C@propel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I thought that the number of tuples in a table must be greater than the
number of rows? For one of my tables, I have the following:
# analyze t_stats;
ANALYZE
siteserverdb=# select reltuples, relpages from pg_class where relname =
't_stats';
reltuples | relpages
-----------+----------
1760 | 21119
(1 row)

siteserverdb=# select count(*) from t_stats;
count
-------
1861
(1 row)

How is this possible?

I'm running postgres 8.0 on a redhat ws3. Clearly I'm not vacuuming
enough, but that seems to be a separate issue to me. Am I seeing data
corruption?

Thanks,
Eric

Eric Brown
408-571-6341
www.propel.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2005-02-23 17:06:22 Re: Help with a very newbie question...
Previous Message vinita bansal 2005-02-23 16:51:29 equivalent in postgres of over(partition) function in db2