Skip site navigation (1) Skip section navigation (2)

Re: Select max(foo) and select count(*) optimization

From: CoL <col(at)mportal(dot)hu>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Select max(foo) and select count(*) optimization
Date: 2004-01-06 11:51:13
Message-ID: bte7eh$2jdt$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-performance
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.

In response to

pgsql-performance by date

Next:From: D'Arcy J.M. CainDate: 2004-01-06 12:18:08
Subject: Re: Select max(foo) and select count(*) optimization
Previous:From: Shridhar DaithankarDate: 2004-01-06 06:42:21
Subject: Re: Select max(foo) and select count(*) optimization

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group