pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-performance@postgresql.org
Subject: Re: Select max(foo) and select count(*) optimization
Date: Tue, 06 Jan 2004 12:51:13 +0100
Message-ID: <bte7eh$2jdt$1@news.hub.org> (raw)
In-Reply-To: <200401061212.21344.shridhar_daithankar@persistent.co.in>
References: <BC1F1F20.71370%siracusa@mindspring.com>
	<1073332325.8958.8.camel@jester>
	<200401061212.21344.shridhar_daithankar@persistent.co.in>

Hi,

Shridhar Daithankar wrote:

> 
> select relpages,reltuples from pg_class where relname=<tablename>;
> 
> Assuming the stats are recent enough, it would be much faster and accurate..

this needs an analyze <tablename>; before select from pg_class, cause 
only after analyze will update pg the pg_class

C.



view thread (19+ messages)  latest in thread

Message-ID: <bte7eh$2jdt$1@news.hub.org>
Permalink:  ../bte7eh$2jdt$1@news.hub.org/
Also on:    postgresql.org/message-id/bte7eh$2jdt$1@news.hub.org

 · 

reply

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: col@mportal.hu
  Subject: Re: Select max(foo) and select count(*) optimization
  In-Reply-To: <bte7eh$2jdt$1@news.hub.org>

* 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