pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Gábor Farkas <gabor@nekomancer.net>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: select count(*) performance (vacuum did not help)
Date: Mon, 24 Sep 2007 17:34:16 +0200
Message-ID: <1190648056.4661.251.camel@PCD12478> (raw)
In-Reply-To: <46F7D453.4050908@nekomancer.net>
References: <46F7C494.1050604@nekomancer.net>
	<46F7C9F1.1080805@enterprisedb.com>
	<46F7D207.3000901@nekomancer.net>
	<46F7D2C7.70105@enterprisedb.com>
	<46F7D453.4050908@nekomancer.net>

On Mon, 2007-09-24 at 17:14 +0200, Gábor Farkas wrote:
> will i achieve the same thing by simply dropping that table and 
> re-creating it?

If you have an index/PK on that table, the fastest and most useful way
to rebuild it is to do CLUSTER on that index. That will be a lot faster
than VACUUM FULL and it will also order your table in index order... but
it will also lock it in exclusive mode just as VACUUM FULL would do it.
If your table has just a few live rows and lots of junk in it, CLUSTER
should be fast enough. With 20K entries I would expect it to be fast
enough not to be a problem...

Cheers,
Csaba.





view thread (9+ messages)  latest in thread

Message-ID: <1190648056.4661.251.camel@PCD12478>
Permalink:  ../1190648056.4661.251.camel@PCD12478/
Also on:    postgresql.org/message-id/1190648056.4661.251.camel@PCD12478

 · 

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: nagy@ecircle-ag.com, gabor@nekomancer.net, heikki@enterprisedb.com
  Subject: Re: select count(*) performance (vacuum did not help)
  In-Reply-To: <1190648056.4661.251.camel@PCD12478>

* 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