From: Virag Saksena <virag@auptyma.com>
To: pgsql-performance@postgresql.org
Subject: Re: Is there an equivalent for Oracle's user_tables.num_rows
Date: Fri, 9 Feb 2007 17:08:47 -0800
Message-ID: <00c801c74cb0$04a27820$2900000a@demo01> (raw)
References: <00aa01c74ca6$7392a160$2900000a@demo01>
<6478.1171068303@sss.pgh.pa.us>
Thanks, that is exactly what I was looking for
I know that number of rows may not be the best indicator, but it is a
heuristic that can be tracked
easily, causing analyze for the first x insert events, and then only doing
it only when an insert event causes
total rows to exceed y % of the optimizer perceived rows
Other more accurate heuristics like relative distribution of columns would
be harder to track in the application,
and I'd rather let the database do that by issuing the analyze
Regards,
Virag
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Virag Saksena" <virag@auptyma.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Friday, February 09, 2007 4:45 PM
Subject: Re: [PERFORM] Is there an equivalent for Oracle's
user_tables.num_rows
> "Virag Saksena" <virag@auptyma.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
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: virag@auptyma.com
Subject: Re: Is there an equivalent for Oracle's user_tables.num_rows
In-Reply-To: <00c801c74cb0$04a27820$2900000a@demo01>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox