Home > Archive > PostgreSQL SQL > December 2006 > Autovaccum









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Autovaccum
Ezequias Rodrigues da Rocha

2006-11-30, 7:20 pm

Hi list,

I would like to know if it is necessary to set my database to
autovaccum if the intent of my DB Manager is do not make any deletion
in any time.

If there is no deletions why autovaccum ok ?


Regards
Ezequias

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Alvaro Herrera

2006-11-30, 7:20 pm

Ezequias Rodrigues da Rocha wrote:
> Hi list,
>
> I would like to know if it is necessary to set my database to
> autovaccum if the intent of my DB Manager is do not make any deletion
> in any time.
>
> If there is no deletions why autovaccum ok ?


You need to vacuum from time to time anyway, even if you don't delete
anything. The easiest way to do it is let autovacuum do it for you.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Peter Childs

2006-11-30, 7:20 pm

On 30/11/06, Alvaro Herrera < alvherre@commandprom
pt.com> wrote:
> Ezequias Rodrigues da Rocha wrote:
>
> You need to vacuum from time to time anyway, even if you don't delete
> anything. The easiest way to do it is let autovacuum do it for you.
>


Complete Answer.

1. If you do any updates or deletes you need to vacuum.

2. If you do any update, deletes or inserts you need to analyse.

3. If you never change anything No Updates, No Inserts, No Deletes you
need to vacuum once ever 2 billion transactions due to wrap around if
you don't your data will disappear. But depending on how busy your
database is this could be once a year.

4. Auto Vacuum does all this automatically. Which is kind of useful.

5. You can do this manually via cron or by hand if you wish.

Peter.

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Ezequias Rodrigues da Rocha

2006-11-30, 7:20 pm

It is possible to set this up on PgAdmin ?

I need to shutdown the postgresql service to change this parameters ?

ps: Your information was very clear for me. Thank you very much.

Ezequias

2006/11/30, Peter Childs <peterachilds@gmail.com>:
> On 30/11/06, Alvaro Herrera < alvherre@commandprom
pt.com> wrote:
>
> Complete Answer.
>
> 1. If you do any updates or deletes you need to vacuum.
>
> 2. If you do any update, deletes or inserts you need to analyse.
>
> 3. If you never change anything No Updates, No Inserts, No Deletes you
> need to vacuum once ever 2 billion transactions due to wrap around if
> you don't your data will disappear. But depending on how busy your
> database is this could be once a year.
>
> 4. Auto Vacuum does all this automatically. Which is kind of useful.
>
> 5. You can do this manually via cron or by hand if you wish.
>
> Peter.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
> http://www.postgresql.org/about/donate
>



--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Shane Ambler

2006-11-30, 7:20 pm

Alvaro Herrera wrote:
> Ezequias Rodrigues da Rocha wrote:
>
> You need to vacuum from time to time anyway, even if you don't delete
> anything. The easiest way to do it is let autovacuum do it for you.
>


One thing that vacuum/autovacuum does is mark space used by deleted rows
to be reused. Without deletes this won't be necessary in table data
files. But when you update a record an index may also be updated and
have the same effect within the index storage space.

There are other things that vacuum does to keep your database running
optimally. One is to update planner statistics about how many rows are
in each table which effects the query planning and optimizing.

Without deletes a plain vacuum won't achieve a great deal, but a regular
VACUUM ANALYZE (as done by autovacuum) will make a difference to the
performance of your database.

If no data in your db changes then you won't have to bother vacuuming.

--

Shane Ambler
pgSQL@007Marketing.com

Get Sheeky @ http://Sheeky.Biz

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Matthew T. O'Connor

2006-11-30, 7:20 pm

Ezequias Rodrigues da Rocha wrote:
> It is possible to set this up on PgAdmin ?


I don't know.

> I need to shutdown the postgresql service to change this parameters ?


No, you can just modify the params in postgresql.conf and HUP the server
so that it re-reads the config file, no restart required.



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Ezequias Rodrigues da Rocha

2006-11-30, 7:20 pm

Just a little question.

What is the interval of time the vacuum will run on my database ?

Ezequias

2006/11/30, Matthew T. O'Connor <matthew@zeut.net>:
> Ezequias Rodrigues da Rocha wrote:
>
> I don't know.
>
>
> No, you can just modify the params in postgresql.conf and HUP the server
> so that it re-reads the config file, no restart required.
>
>
>



--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Shane Ambler

2006-12-01, 7:18 pm

Ezequias Rodrigues da Rocha wrote:
> Could you tell me if only this both options are ok (attach) ?
>
> If I don't mark the interval of vacuuns what will be the interval of
> each vacuum ?


The default settings may be fine for you, it depends a bit on how many
insert/updates you get in a given time frame.

http://www.postgresql.org/docs/8.1/...autovacuum.html
will give a definition of each parameter that can be set.

http://www.postgresql.org/docs/8.1/...html#AUTOVACUUM
will explain in more detail.

Basically every autovacuum_naptime seconds autovacuum looks at estimates
of how much the database has changed since the last run. If the amount
of change is greater than the thresholds determined from the other
settings then a vacuum/analyze will be done.

If you have 100 records added/updated per day then you may only need it
to run 1 or 2 times a day using smaller thresholds.

If you are adding 10,000 records an hour then you will want it to run
more often.


> 2006/11/30, Shane Ambler <pgsql@007marketing.com>:
>
>



--

Shane Ambler
pgSQL@007Marketing.com

Get Sheeky @ http://Sheeky.Biz

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com