Re: Really really slow select count(*) - Mailing list pgsql-performance

From Greg Smith
Subject Re: Really really slow select count(*)
Date
Msg-id 4D4C478D.9070909@2ndquadrant.com
Whole thread Raw
In response to Re: Really really slow select count(*)  (felix <crucialfelix@gmail.com>)
Responses Re: Really really slow select count(*)
List pgsql-performance
felix wrote:
> and do you agree that I should turn CLUSTER ON ?
> I have no problem to stop all tasks to this table at night and just
> reload it

You don't turn it on; it's a one time operation that does a cleanup.  It
is by far the easiest way to clean up the mess you have right now.
Moving forward, if you have max_fsm_pages set to an appropriate number,
you shouldn't end up back in this position again.  But VACUUM along
won't get you out of there, and VACUUM FULL is always a worse way to
clean this up than CLUSTER.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


pgsql-performance by date:

Previous
From: Shaun Thomas
Date:
Subject: Re: Really really slow select count(*)
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Slow count(*) again...