Re: Vaccum

From: raja kumar thatte <trajakumar(at)yahoo(dot)com>
To: "Leong, Fushan" <fushan(dot)leong(at)SonoSite(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Vaccum
Date: 2001-11-30 04:06:39
Message-ID: 20011130040639.5822.qmail@web20602.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)leong(at)SonoSite(dot)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.

In response to

  • Vaccum at 2001-11-29 17:15:00 from Leong, Fushan

Browse pgsql-admin by date

  From Date Subject
Next Message Manuel Trujillo 2001-11-30 08:46:40 Re: table test
Previous Message Brett W. McCoy 2001-11-29 22:43:53 Re: Visio