Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 2CBF19FA281 for ; Fri, 9 Feb 2007 20:47:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 52042-10 for ; Fri, 9 Feb 2007 20:47:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id F21D79FA19A for ; Fri, 9 Feb 2007 20:47:47 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l1A0j3m7006479; Fri, 9 Feb 2007 19:45:03 -0500 (EST) To: "Virag Saksena" cc: pgsql-performance@postgresql.org Subject: Re: Is there an equivalent for Oracle's user_tables.num_rows In-reply-to: <00aa01c74ca6$7392a160$2900000a@demo01> References: <00aa01c74ca6$7392a160$2900000a@demo01> Comments: In-reply-to "Virag Saksena" message dated "Fri, 09 Feb 2007 16:00:18 -0800" Date: Fri, 09 Feb 2007 19:45:03 -0500 Message-ID: <6478.1171068303@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/110 X-Sequence-Number: 23164 "Virag Saksena" 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