Search Postgresql Archives

Re: reltuples < # of rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Brown <eric.brown@xxxxxxxxxx> writes:
> 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?

ANALYZE produces only an estimated reltuples.  To be exact it would have
to scan the entire table.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux