Re: postgresql is slow with larger table even it is in RAM - Mailing list pgsql-performance

From Craig Ringer
Subject Re: postgresql is slow with larger table even it is in RAM
Date
Msg-id 47E8C72B.2010105@postnewspapers.com.au
Whole thread Raw
In response to Re: postgresql is slow with larger table even it is in RAM  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-performance
hubert depesz lubaczewski wrote:
> On Tue, Mar 25, 2008 at 02:05:20PM +0530, sathiya psql wrote:
>> Any Idea on this ???
>
> yes. dont use count(*).
>
> if you want whole-table row count, use triggers to store the count.
>
> it will be slow. regeardless of whether it's in ram or on hdd.

In other words, if you're having performance problems please provide
EXPLAIN ANALYZE output from a more useful query that does real work,
rather than something like count(*).

COUNT(*) can be slow due to some MVCC limitations; it's been discussed
frequently here so you should search the archives for information.

--
Craig Ringer

pgsql-performance by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: postgresql is slow with larger table even it is in RAM
Next
From: "sathiya psql"
Date:
Subject: what is the maximum number of rows in a table in postgresql 8.1