#define TABLE_STATS_QUERY "select a.oid,a.relname,a.relnamespace,a.relpages,a.relisshared,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_all_tables b where a.oid=b.relid and a.relkind = 'r'"
#define FRONTEND
#define PAGES_QUERY "select oid,reltuples,relpages from pg_class where oid=%i"
#define PAGES_QUERY "select oid,reltuples,relpages from pg_class where oid=%u"
#define FROZENOID_QUERY "select oid,age(datfrozenxid) from pg_database where datname = 'template1'"
#define FROZENOID_QUERY2 "select oid,datname,age(datfrozenxid) from pg_database where datname!='template0'"
/* define atooid */
#define atooid(x) ((Oid) strtoul((x), NULL, 10))
/* define cmd_args stucture */
structcmdargs
{
...
...
@@ -67,9 +70,9 @@ cmd_args *args;
I think we need to guarantee this happens approx every 1Million TX's */
structdbinfo
{
intoid,
age;
intanalyze_threshold,
Oidoid;
longage;
longanalyze_threshold,
vacuum_threshold;/* Use these as defaults for table