On Monday, Jun 28, Todd R. Eisenschink wrote:
... a program called AutoVac which loops over all the databases controlled by
Postgresql, drops each index, VACUUM ANALYZE each table and then re-creates the
index. An interesting mixture of shell, Perl and psql (no complaint, mind you;
it is more than I have done) about which he asked for comments.
I am very pleased to see the program written and think it may be useful for
others. I wonder if it might be written "more elegantly", somehow accessing the
Postgresql meta-data directly, but that is by way of musing rather than
critisism, for I don't know how to do it.
My comment on the code is:
As I read the Perl regular expressions, I don't see provision made for:
"CREATE UNIQUE INDEX"
Todd uses:
if( /CREATE\s+INDEX ...) to match the index lines
Shouldn't it be:
if(/CREATE.+INDEX ...) ?
Thanks for the code and ideas, Todd; I have kept a copy for my files.
Mark
--
Mark Dalphin email: [EMAIL PROTECTED]
Mail Stop: 29-2-A phone: +1-805-447-4951 (work)
One Amgen Center Drive +1-805-375-0680 (home)
Thousand Oaks, CA 91320 fax: +1-805-499-9955 (work)