Re: Is there an equivalent for Oracle's user_tables.num_rows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Virag Saksena" <virag(at)auptyma(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Is there an equivalent for Oracle's user_tables.num_rows
Date: 2007-02-10 00:45:03
Message-ID: 6478.1171068303@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Virag Saksena" <virag(at)auptyma(dot)com> writes:
> Does someone know of a way of telling what the optimizer believes the =
> number of rows are ?

You're looking in the wrong place; see pg_class.relpages and reltuples.

But note that in recent releases neither one is taken as gospel.
Instead the planner uses the current physical table size in place of
relpages, and scales reltuples correspondingly. So neither steady
growth nor truncation create a need for re-ANALYZE; at least not as long
as the other statistics don't change too much.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Simon Riggs 2007-02-10 01:06:37 Re: Is there an equivalent for Oracle'suser_tables.num_rows
Previous Message Virag Saksena 2007-02-10 00:00:18 Is there an equivalent for Oracle's user_tables.num_rows