#define TABLE_STATS_ALL "select a.relfilenode,a.relname,a.relnamespace,a.relpages,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.relfilenode=b.relid"
#define TABLE_STATS_USER "select a.relfilenode,a.relname,a.relnamespace,a.relpages,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_user_tables b where a.relfilenode=b.relid"
#define FRONTEND
structcmdargs{
inttuple_base_threshold,sleep_base_value,debug;
floattuple_scaling_factor,sleep_scaling_factor;
char*user,*password,*host,*port;
};typedefstructcmdargscmd_args;
/* define cmd_args as global so we can get to them everywhere */
cmd_args*args;
structtableinfo{
char*schema_name,*table_name;
intinsertThreshold,deleteThreshold;
intrelfilenode,reltuples,relpages;
longInsertsAtLastAnalyze;/* equal to: inserts + updates as of the last analyze or initial values at startup */
longDeletesAtLastVacuum;/* equal to: deletes + updates as of the last vacuum or initial values at startup */
};typedefstructtableinfotbl_info;
/* Might need to add a time value for last time the whold database was vacuumed.