Skip site navigation (1) Skip section navigation (2)

Re: Enhancement request

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Enhancement request
Date: 2007-11-30 22:23:25
Message-ID: 60bq9b5q5e.fsf@dba2.int.libertyrms.com (view raw or flat)
Thread:
Lists: pgsql-admin
jonah(dot)harris(at)gmail(dot)com ("Jonah H. Harris") writes:
> On Nov 30, 2007 4:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> For what?
>
> Convenience.
>
>> AFAICS we are moving as fast as we can in the direction of auto vacuum
>> and analyze.  Adding more frammishes to the manual commands seems like
>> gilding the buggy whip.
>
> Autovacuum will never be the be all end all.

And why is does it not suffice to do the following?

SCHEMA=billing
for table in `psql -qt -d my_database -c "select table_name from information_schema.tables where table_schema = '${SCHEMA}' and table_type = 'BASE TABLE';"`; do
psql -d my_database -c "vacuum analyze ${SCHEMA}.${table};"
done

I don't see a need to add more to the SQL grammar when the above can
be done in 4 lines of shell script.

It seems to me that if you actually *NEED* to do 'sophisticated
logic-driven' VACUUMing, then you are already headed down a road where
you will need to have:

a) A script

b) Some query criteria, whether in the DBMS, or purely within the
shell, to handle the "logic" bit.

Once you're there, you have *AT LEAST* the 4 lines of script that I
suggested, if not considerably more.

Interestingly, the .sig chosen below actually seems somewhat germaine
to this...

What you're asking for, whether it's "gilding the buggy whip" or
"adding frammishes to manual commands" [1], is, in fact, MORE that
you're suggesting it is.  You're not merely looking for a "frammish,"
you're proposing that it is meaningful for us to encourage a policy of
vacuuming on a per-schema basis.  That's not merely a mechanism to let
the user do what they want - that's policy.

In contrast, while what is in my little script represents policy, as a
whole, none of the components represent policies in and of themselves.

Footnotes: 
[1]  I *love* the way Tom phrased that; that sentence is going into my
personal "fortunes" file...
-- 
output = reverse("ofni.sesabatadxunil" "@" "enworbbc")
http://www3.sympatico.ca/cbbrowne/languages.html
People consistently decry  X for doing precisely what  it was designed
to do: provide a mechanism to allow *OTHERS* to build GUI systems.
-- John Stevens <jstevens(at)samoyed(dot)ftc(dot)nrcs(dot)usda(dot)gov> 

In response to

Responses

pgsql-admin by date

Next:From: Alvaro HerreraDate: 2007-11-30 22:34:02
Subject: Re: Enhancement request
Previous:From: Ivo RossacherDate: 2007-11-30 22:05:44
Subject: Re: Character Corruption / Encoding Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group