Re: Vaccum - Mailing list pgsql-admin

From raja kumar thatte
Subject Re: Vaccum
Date
Msg-id 20011130040639.5822.qmail@web20602.mail.yahoo.com
Whole thread Raw
In response to Vaccum  ("Leong, Fushan" <fushan.leong@SonoSite.com>)
List pgsql-admin

No problem, we are doing vaccume different tables at different times.

Because if you do vaccume it will decrease the performace of data base

you can write scripts like this.

-----cleanTable.sh--------------------

#!/sbin/sh
echo "############## START:## Clean Table  $1 ##"
/usr/local/pgsql/bin/psql -U xxxxx -d xxxxxxx << end
vacuum  verbose  analyze $1;
\q
end
echo "############## END:## Clean Table  $1 ##"

-----cleanDB.sh--------------------------

#!/sbin/sh

#the following entry should be made in crontab of postgresql account
#5      *       *       *       *       $HOME/cleanDB.sh

echo "############## START:## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'`
HOR=`date '+ %H'`
if [ $HOR -eq 19 ]; then
        /sbin/sh $HOME/cleanTable.sh aaaaaaaaaaa
        /sbin/sh $HOME/cleanTable.sh bbbbbbbbbbbb

elif [ $HOR -eq 20 ]; then
        /sbin/sh $HOME/cleanTable.sh cccccccccccc

elif [ $HOR -eq 21 ]; then
        /sbin/sh $HOME/cleanTable.sh dddddd
        /sbin/sh $HOME/cleanTable.sh eeeeeee

elif [ $HOR -eq 22 ]; then
        /sbin/sh $HOME/cleanTable.sh ffffffff
        /sbin/sh $HOME/cleanTable.sh ggggggggggggg


elif [ $HOR -eq 03 ]; then
        /sbin/sh $HOME/cleanTable.sh hhhhhhhhh


else
        echo "-------Nothing to vacuum--------"
fi
echo "############## END  :## Clean DB ## "`date '+%d/%m/%y %H:%M:%S'`    
                                                          

__________________________________                    

  "Leong, Fushan" <fushan.leong@SonoSite.com> wrote:

Hi :

Want to get your opinion.

I am thinking to schedule to run Vaccum everynight.

1) As I understand, Vaccum is the command to delete old data, right?
1) Do I have to stop the postmaster before run the Vaccum command?
2) Should I run it everynight? How often should I run it?

thanks
Fushan

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

http://archives.postgresql.org



Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.

pgsql-admin by date:

Previous
From: "Brett W. McCoy"
Date:
Subject: Re: Visio
Next
From: Manuel Trujillo
Date:
Subject: Re: table test