Re: Another question on indexes (drop and recreate) - Mailing list pgsql-performance

From Yves Vindevogel
Subject Re: Another question on indexes (drop and recreate)
Date
Msg-id 09f30bc29a91c94eecaf7f70aa0c8399@implements.be
Whole thread Raw
In response to Re: Another question on indexes (drop and recreate)  (John A Meinel <john@arbash-meinel.com>)
Responses Re: Another question on indexes (drop and recreate)
List pgsql-performance
I only add records, and most of the values are "random"

Except the columns for dates, ....


On 21 Jun 2005, at 17:49, John A Meinel wrote:


<excerpt>Yves Vindevogel wrote:


<excerpt>And, after let's say a week, would that index still be
optimal or

would it be a good idea to drop it in the weekend and recreate it.

</excerpt>


It depends a little bit on the postgres version you are using. If you

are only ever adding to the table, and you are not updating it or

deleting from it, I think the index is always optimal.

Once you start deleting from it there are a few cases where older

versions would not properly re-use the empty entries, requiring a

REINDEX. (Deleting low numbers and always adding high numbers was one
of

the cases)


However, I believe that as long as you vacuum often enough, so that the

system knows where the unused entries are, you don't ever have to drop

and re-create the index.


John

=:->



</excerpt>Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller>I only add records, and most of the values are "random"
Except the columns for dates, ....

On 21 Jun 2005, at 17:49, John A Meinel wrote:

> Yves Vindevogel wrote:
>
>> And, after let's say a week, would that index still be optimal or
>> would it be a good idea to drop it in the weekend and recreate it.
>
>
> It depends a little bit on the postgres version you are using. If you
> are only ever adding to the table, and you are not updating it or
> deleting from it, I think the index is always optimal.
> Once you start deleting from it there are a few cases where older
> versions would not properly re-use the empty entries, requiring a
> REINDEX. (Deleting low numbers and always adding high numbers was one
> of
> the cases)
>
> However, I believe that as long as you vacuum often enough, so that the
> system knows where the unused entries are, you don't ever have to drop
> and re-create the index.
>
> John
> =:->
>
>
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

<smaller>


Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.</x-tad-smaller></italic></smaller>



Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76

Web: http://www.implements.be

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.
Mahatma Ghandi.

Attachment

pgsql-performance by date:

Previous
From: "Mohan, Ross"
Date:
Subject: Re: Trying to figure out pgbench
Next
From: John A Meinel
Date:
Subject: Re: Another question on indexes (drop and recreate)