pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <greg@2ndquadrant.com>
To: felix <crucialfelix@gmail.com>
Cc: sthomas@peak6.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Really really slow select count(*)
Date: Fri, 04 Feb 2011 13:38:05 -0500
Message-ID: <4D4C478D.9070909@2ndquadrant.com> (raw)
In-Reply-To: <AANLkTikjw46g=VD5vbkOfDz93JMX7vBijj7dTEs+LN4U@mail.gmail.com>
References: <AANLkTinAJcm5A+i1O_R87aiYyu8N2OWgoaL9RfR=tUR9@mail.gmail.com>
	<4D4C138C.7010304@2ndquadrant.com>
	<4D4C1555.40209@peak6.com>
	<AANLkTikrS5JkJDMjAXpcRWRnuLbX+MHB=CWb_mFa9qb-@mail.gmail.com>
	<4D4C2AC3.5020804@peak6.com>
	<AANLkTikN75hcCL5Nhgh8Z9c7ZLtduMdjsn07BgO_D_yZ@mail.gmail.com>
	<AANLkTikpH2ws_iiyqNE-o-TWB0-5pMbrS0V5SymXBo2X@mail.gmail.com>
	<AANLkTi=3n_W-OFVuVHx3Tthn_KiMN42BturJUS5BuWVz@mail.gmail.com>
	<4D4C3BCA.5010808@peak6.com>
	<AANLkTikjw46g=VD5vbkOfDz93JMX7vBijj7dTEs+LN4U@mail.gmail.com>

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




view thread (66+ messages)  latest in thread

Message-ID: <4D4C478D.9070909@2ndquadrant.com>
Permalink:  ../4D4C478D.9070909@2ndquadrant.com/
Also on:    postgresql.org/message-id/4D4C478D.9070909@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: greg@2ndquadrant.com, crucialfelix@gmail.com, sthomas@peak6.com
  Subject: Re: Really really slow select count(*)
  In-Reply-To: <4D4C478D.9070909@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox