469,572 Members | 1,325 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Vacuum, per table or entire database? what is better?

Hi ,

I am developing a script that will delete old data from various tables
in a database periodically. The script deletes data from all the tables,
one by one, in single go. I have two options of running vacuum here -
One is to run vacuum analyze each time the table data is deleted, or
another is to run vacuum analyze after the data is deleted from all the
tables. Please note that data has been deleted from all the tables and
not just a few tables. Also, the size of data that will be deleted may
be different at different instances and differs from table to table.
Which one would work faster and better, per table or entire database?

Please respond.

Thanks in advance,

Regards,

Yateen V. Joshi


Nov 23 '05 #1
1 1688
yateen joshi wrote:
Hi ,

I am developing a script that will delete old data from various tables
in a database periodically. The script deletes data from all the tables,
one by one, in single go. I have two options of running vacuum here -
One is to run vacuum analyze each time the table data is deleted, or
another is to run vacuum analyze after the data is deleted from all the
tables. Please note that data has been deleted from all the tables and
not just a few tables. Also, the size of data that will be deleted may
be different at different instances and differs from table to table.
Which one would work faster and better, per table or entire database?


If you're going to vacuum all the tables anyway, it makes no practical
difference, you're just deciding when to do the work.

Oh - and I'd not bother analysing if you're going to bulk-reload the
tables again. Analyse them as you reload.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Alex | last post: by
5 posts views Thread by Gavin Scott | last post: by
reply views Thread by Jim Seymour | last post: by
reply views Thread by Rajesh Kumar Mallah | last post: by
6 posts views Thread by spied | last post: by
9 posts views Thread by Aleksey Serba | last post: by
1 post views Thread by lion cave | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.