Re: [PERFORM] How to vacuum entire database excluding some tables inPostgreSQL9.1. - Mailing list pgsql-performance

From ProPAAS DBA
Subject Re: [PERFORM] How to vacuum entire database excluding some tables inPostgreSQL9.1.
Date
Msg-id 91979dcd-9168-734d-e7e0-25f35d2ebd2f@propaas.com
Whole thread Raw
In response to [PERFORM] How to vacuum entire database excluding some tables in PostgreSQL9.1.  (Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>)
List pgsql-performance

Something like this in a bash script?


#!/bin/bash

echo "select schemaname, tablename from pg_tables where tablename not in (your list of excluded tables) and schemaname not in ('information_schema', 'pg_catalog')" | psql -t > /tmp/tablist

exec < /tmp/tablist
while read line
do
     set - $line
     echo "Vacuuming [$1] [$3]"
     echo "VACUUM VERBOSE ${1}.${3}" | psql

done




On 12/21/2016 10:49 AM, Dinesh Chandra 12108 wrote:

Dear Expert,

 

Could you please suggest me for the below query?

 

I want to vacuum the entire database with the exception of several

tables.

 

Because there are some tables which are very big in size, so I just want to exclude them.

 

Thanks in advance.

 

Regards,

Dinesh Chandra

|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.

------------------------------------------------------------------

Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com

Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.

 




DISCLAIMER:

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Check all attachments for viruses before opening them. All views or opinions presented in this e-mail are those of the author and may not reflect the opinion of Cyient or those of our affiliates.

pgsql-performance by date:

Previous
From: Dinesh Chandra 12108
Date:
Subject: [PERFORM] How to vacuum entire database excluding some tables in PostgreSQL9.1.
Next
From: Jeremy Harris
Date:
Subject: Re: [PERFORM] bad performance