2005-07-14 07:13:45 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* pg_autovacuum.h
|
|
|
|
* definition of the system "autovacuum" relation (pg_autovacuum)
|
|
|
|
*
|
2008-01-01 20:46:01 +01:00
|
|
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
2005-07-14 07:13:45 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2008-01-01 20:46:01 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/catalog/pg_autovacuum.h,v 1.8 2008/01/01 19:45:56 momjian Exp $
|
2005-07-14 07:13:45 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PG_AUTOVACUUM_H
|
|
|
|
#define PG_AUTOVACUUM_H
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* postgres.h contains the system type definitions and the
|
|
|
|
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
|
|
|
|
* can be read by both genbki.sh and the C compiler.
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* pg_autovacuum definition. cpp turns this into
|
|
|
|
* typedef struct FormData_pg_autovacuum
|
|
|
|
* ----------------
|
|
|
|
*/
|
2005-10-15 04:49:52 +02:00
|
|
|
#define AutovacuumRelationId 1248
|
2005-07-14 07:13:45 +02:00
|
|
|
CATALOG(pg_autovacuum,1248) BKI_WITHOUT_OIDS
|
|
|
|
{
|
2007-11-15 22:14:46 +01:00
|
|
|
Oid vacrelid; /* OID of table */
|
|
|
|
bool enabled; /* enabled for this table? */
|
2005-07-14 07:13:45 +02:00
|
|
|
int4 vac_base_thresh; /* base threshold value */
|
2007-11-15 22:14:46 +01:00
|
|
|
float4 vac_scale_factor; /* reltuples scaling factor */
|
2005-07-14 07:13:45 +02:00
|
|
|
int4 anl_base_thresh; /* base threshold value */
|
2007-11-15 22:14:46 +01:00
|
|
|
float4 anl_scale_factor; /* reltuples scaling factor */
|
|
|
|
int4 vac_cost_delay; /* vacuum cost-based delay */
|
|
|
|
int4 vac_cost_limit; /* vacuum cost limit */
|
|
|
|
int4 freeze_min_age; /* vacuum min freeze age */
|
|
|
|
int4 freeze_max_age; /* max age before forcing vacuum */
|
2005-07-14 07:13:45 +02:00
|
|
|
} FormData_pg_autovacuum;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* Form_pg_autovacuum corresponds to a pointer to a tuple with
|
|
|
|
* the format of pg_autovacuum relation.
|
|
|
|
* ----------------
|
|
|
|
*/
|
|
|
|
typedef FormData_pg_autovacuum *Form_pg_autovacuum;
|
|
|
|
|
|
|
|
/* ----------------
|
|
|
|
* compiler constants for pg_autovacuum
|
|
|
|
* ----------------
|
|
|
|
*/
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
#define Natts_pg_autovacuum 10
|
2005-07-14 07:13:45 +02:00
|
|
|
#define Anum_pg_autovacuum_vacrelid 1
|
|
|
|
#define Anum_pg_autovacuum_enabled 2
|
|
|
|
#define Anum_pg_autovacuum_vac_base_thresh 3
|
|
|
|
#define Anum_pg_autovacuum_vac_scale_factor 4
|
|
|
|
#define Anum_pg_autovacuum_anl_base_thresh 5
|
|
|
|
#define Anum_pg_autovacuum_anl_scale_factor 6
|
2005-08-11 23:11:50 +02:00
|
|
|
#define Anum_pg_autovacuum_vac_cost_delay 7
|
|
|
|
#define Anum_pg_autovacuum_vac_cost_limit 8
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
#define Anum_pg_autovacuum_freeze_min_age 9
|
|
|
|
#define Anum_pg_autovacuum_freeze_max_age 10
|
2005-07-14 07:13:45 +02:00
|
|
|
|
|
|
|
/* There are no preloaded tuples in pg_autovacuum.h */
|
|
|
|
|
|
|
|
#endif /* PG_AUTOVACUUM_H */
|