X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 55B1CD1B4C7 for ; Tue, 6 Jan 2004 12:05:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62414-02 for ; Tue, 6 Jan 2004 08:04:36 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 8F76DD1B449 for ; Tue, 6 Jan 2004 08:04:28 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i06C4WU6092633 for ; Tue, 6 Jan 2004 12:04:32 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i06BogVQ085444 for pgsql-performance@postgresql.org; Tue, 6 Jan 2004 11:50:42 GMT From: CoL X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Select max(foo) and select count(*) optimization Date: Tue, 06 Jan 2004 12:51:13 +0100 Organization: Hub.Org Networking Services Lines: 13 Message-ID: References: <1073332325.8958.8.camel@jester> <200401061212.21344.shridhar_daithankar@persistent.co.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en In-Reply-To: <200401061212.21344.shridhar_daithankar@persistent.co.in> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/88 X-Sequence-Number: 5263 Hi, Shridhar Daithankar wrote: > > select relpages,reltuples from pg_class where relname=; > > Assuming the stats are recent enough, it would be much faster and accurate.. this needs an analyze ; before select from pg_class, cause only after analyze will update pg the pg_class C.