Re: Vacuum-full very slow

Поиск
Список
Период
Сортировка
Искать
От
Steve Crawford
Тема
Re: Vacuum-full very slow
Дата
Msg-id
462FA330.8080402@pinpointresearch.com
Ответ на
Re: Vacuum-full very slow (Martijn van Oosterhout)
Список
Дерево обсуждения
Vacuum-full very slow Steve Crawford <scrawford@pinpointresearch.com>
Re: Vacuum-full very slow Alvaro Herrera <alvherre@commandprompt.com>
Re: Vacuum-full very slow Tom Lane <tgl@sss.pgh.pa.us>
Re: Vacuum-full very slow Steve Crawford <scrawford@pinpointresearch.com>
Re: Vacuum-full very slow Martijn van Oosterhout <kleptog@svana.org>
Re: Vacuum-full very slow Steve Crawford <scrawford@pinpointresearch.com>
Re: Vacuum-full very slow Alvaro Herrera <alvherre@commandprompt.com>
Re: Vacuum-full very slow Tom Lane <tgl@sss.pgh.pa.us>
Re: Vacuum-full very slow Steve Crawford <scrawford@pinpointresearch.com>
Re: Vacuum-full very slow Listmail <lists@peufeu.com>
Re: Vacuum-full very slow "Simon Riggs" <simon@2ndquadrant.com>
Re: Vacuum-full very slow Martijn van Oosterhout <kleptog@svana.org>
Re: Vacuum-full very slow Alvaro Herrera <alvherre@commandprompt.com>
Schema as versioning strategy Owen Hartnett <owen@clipboardinc.com>
Re: Schema as versioning strategy Reece Hart <reece@harts.net>
Re: Schema as versioning strategy Richard Huxton <dev@archonet.com>
Re: Schema as versioning strategy Jonathan Vanasco <jvanasco@2xlp.com>
Re: Schema as versioning strategy Richard Huxton <dev@archonet.com>
Re: Schema as versioning strategy Owen Hartnett <owen@clipboardinc.com>
Re: Schema as versioning strategy Alban Hertroys <alban@magproductions.nl>
Martijn van Oosterhout wrote:
> On Wed, Apr 25, 2007 at 09:36:35AM -0700, Steve Crawford wrote:
>> Hmmm, why would cluster be faster?
> 
> Basically, vacuum full moves tuples from the end to the beginning of a
> table so it can compact the table. In the process it needs to update
> all the indexes too. So you save heap space but it tends to fragment
> your index. Lots of disk writes also.
> 
> OTOH, cluster simply scans the table, sorts it, writes it out then
> rebuilds the indexes. If you've removed a lot of tuples, empirically
> it's faster.
> 
> VACUUM FULL is discouraged these days, simply becuase it isn't actually
> as efficient as you might expect. Better to make sure it doesn't grow
> big in the first place, and use CLUSTER to rebuild the table if you
> really need to.
> 
> Hope this helps,

So my mental-model is utterly and completely wrong. My assumption was
that since a full vacuum requires an access exclusive lock, it would do
the intelligent and efficient thing which would be to first compact the
table and then recreate the indexes.

Am I reading that what it actually does is to thrash around keeping
indexes unnecessarily updated, bloating them in the process?

Will cluster reduce the on-disk size like vacuum does?

(

And am I the only one who thinks the cluster command is backwards -
after all it is the table that is being reordered based on an index so:

CLUSTER tablename ON indexname

seems way more intuitive than

CLUSTER indexname ON tablename

)

Cheers,
Steve

В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: Richard Huxton
Дата:
Сообщение: Re: PosegreSQL support
FAQ