Re: Does VACUUM reorder tables on clustered indices

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Does VACUUM reorder tables on clustered indices
Date: 2005-12-21 23:36:45
Message-ID: 60d5jqja42.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

jnasby(at)pervasive(dot)com ("Jim C. Nasby") writes:
> On Wed, Dec 21, 2005 at 12:34:12AM +0100, ipv(at)tinet(dot)org wrote:
>> Hi,
>>
>> Utilize <b>CLUSTER;</b> (after vacuum) to reorder the data.
>
> Why would you vacuum when cluster is just going to wipe out the dead
> tuples anyway?

There is one reason to VACUUM before running CLUSTER...

That is that VACUUM will be *guaranteed* to draw all the pages into memory.

Subsequently, you can be certain that the pages are in cache, and that
the CLUSTER should need to do minimal I/O to read data into memory.

If I'm considering clustering the Slony-I "sl_log_1" table, forcing it
into memory *is* something I'll consider doing in order to minimize
the time that would-be writers are blocked from writing...
--
let name="cbbrowne" and tld="cbbrowne.com" in String.concat "@" [name;tld];;
http://cbbrowne.com/info/multiplexor.html
Never criticize anybody until you have walked a mile in their shoes,
because by that time you will be a mile away and have their shoes.
-- email sig, Brian Servis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-21 23:40:44 Re: [HACKERS] problem with nasty latin2 sorting
Previous Message Martijn van Oosterhout 2005-12-21 23:14:10 Re: [pgadmin-hackers] Client-side password encryption

Browse pgsql-sql by date

  From Date Subject
Next Message Matthew Smith 2005-12-22 00:59:24 Re: Help on a complex query (avg data for day of the week)
Previous Message Michael Fuhr 2005-12-21 17:56:21 Re: Problem obtaining MAX values FROM TABLE