Search Postgresql Archives

Vacuum does not show in pg_stat_all_tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone,

today when I do select relname, last_autovacuum, last_vacuum from pg_stat_all_tables I see last_vacuum and autovacuum fields is empty. This its seems strange for me, because every night crontab start at 01:10 am a vacuum script that do:

reindex, vacuum full and vacuum analyze. I run vacuumdb not vacuum from command line. I use posgresql 9.1.3.
My question is: Is this a bug or may be my vacuum never is completed ?

Here is my vacuum script if some want a look at it.

#!/bin/sh
PSQL="/usr/bin/psql -U postgres my_db -h 10.0.0.1"

su - postgres -c "/usr/bin/vacuumdb --dbname=my_db --host=10.0.0.1 >> /var/lib/postgres/vacuum.log 2>&1";

# reindex


tables=`$PSQL -t -c "SELECT DISTINCT c.oid::pg_catalog.regclass FROM pg_catalog.pg_index x JOIN pg_catalog.pg_class c ON c.oid = x.indrelid JOIN pg_catalog.pg_namespace n O
N c.relnamespace = n.oid WHERE nspname NOT LIKE 'pg_%'"`

for table in $tables; do
        $PSQL -c "SET autocommit TO 'on'; REINDEX TABLE $table"
        [ "$?" -ne 0 ] && exit 1
done

/usr/bin/vacuumdb --full --dbname=my_db --host=10.0.0.1 >> /var/lib/postgres/vacuum.log 2>&1 su - postgres -c "/usr/bin/vacuumdb --analyze --dbname=my_db --host=10.0.0.1 >> /var/lib/postgres/vacuum.log 2>&1"


Any one can tell me why this is happened ?


Regards,
Condor





--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux