Re: Select max(foo) and select count(*) optimization - Mailing list pgsql-performance

From CoL
Subject Re: Select max(foo) and select count(*) optimization
Date
Msg-id bte7eh$2jdt$1@news.hub.org
Whole thread Raw
In response to Re: Select max(foo) and select count(*) optimization  (Shridhar Daithankar <shridhar_daithankar@persistent.co.in>)
List 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.

pgsql-performance by date:

Previous
From: David Teran
Date:
Subject: Re: optimizing Postgres queries
Next
From: Bradley Tate
Date:
Subject: Slow query problem