Thread: excluding tables from VACUUM ANALYZE

excluding tables from VACUUM ANALYZE

From
"Igor Neyman"
Date:
This question didn't get any "traction on "admin" list, so I'll try here: 

I want to analyze the entire database with the exception of several tables. 
When I run "VACUUM ANALYZE" (or "vacuumdb -z") on the database, how can I exclude specific tables from being analyzed?
Is there any place in system dictionary, where the table could be marked , so it's not processed (skipped) by "vacuum analyze"?
 
Igor 

Re: excluding tables from VACUUM ANALYZE

From
"Nikolas Everett"
Date:
I generally write bash one liners for this kind of thing:

for table in $(psql -U postgres --tuples-only -c "SELECT schemaname || '.' || tablename FROM pg_tables WHERE tablename NOT IN ('table1', 'table2')") ; do psql -U postgres -c "VACUUM ANALYZE $table"; done

This is nice because you can bring all kinds of awk/sed/grep to bear on your problems.

On Thu, Oct 30, 2008 at 9:17 AM, Igor Neyman <ineyman@perceptron.com> wrote:
This question didn't get any "traction on "admin" list, so I'll try here: 

I want to analyze the entire database with the exception of several tables. 
When I run "VACUUM ANALYZE" (or "vacuumdb -z") on the database, how can I exclude specific tables from being analyzed?
Is there any place in system dictionary, where the table could be marked , so it's not processed (skipped) by "vacuum analyze"?
 
Igor 

Re: excluding tables from VACUUM ANALYZE

From
David Fetter
Date:
On Thu, Oct 30, 2008 at 09:17:00AM -0400, Igor Neyman wrote:
> This question didn't get any "traction on "admin" list, so I'll try
> here:
>
> I want to analyze the entire database with the exception of several
> tables.  When I run "VACUUM ANALYZE" (or "vacuumdb -z") on the
> database, how can

Why are you doing this in the first place?  Autovacuum works just
great for modern PostgreSQL versions, and if you're not using one of
those, you should be planning your migration, not propping up the old
one :)

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate