Re: Why does a simple query not use an obvious index?

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Scott Marlowe <smarlowe(at)qwest(dot)net>, Jack Kerkhof <jack(dot)kerkhof(at)guest-tek(dot)com>, Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Why does a simple query not use an obvious index?
Date: 2004-08-29 22:18:20
Message-ID: 1093817899.42199.63.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> People expect count(*) _without a where clause_ to be cached in a single
> global variable. Postgres can't do this, but the reason has everything to do

Someone should write an approx_count('table') function that reads
reltuples from pg_class and tell them to use it in combination with
autovac.

I've yet to see someone use count(*) across a table and not round the
result themselves (approx 9 million clients).

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Russell Smith 2004-08-29 22:31:30 Re: Query performance problem in 8.0.0beta1
Previous Message Greg Stark 2004-08-29 22:10:05 Re: Why does a simple query not use an obvious index?