1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* vacuum.h
|
2001-05-07 02:43:27 +02:00
|
|
|
* header file for postgres vacuum cleaner and statistics analyzer
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*
|
2001-01-24 20:43:33 +01:00
|
|
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2001-11-05 18:46:40 +01:00
|
|
|
* $Id: vacuum.h,v 1.43 2001/11/05 17:46:33 momjian Exp $
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef VACUUM_H
|
|
|
|
#define VACUUM_H
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2001-07-12 06:11:13 +02:00
|
|
|
#include <time.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_GETRUSAGE
|
|
|
|
#include <sys/resource.h>
|
|
|
|
#else
|
|
|
|
#include "rusagestub.h"
|
|
|
|
#endif
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
#include "nodes/parsenodes.h"
|
2001-07-14 00:55:59 +02:00
|
|
|
#include "utils/rel.h"
|
1998-02-26 05:46:47 +01:00
|
|
|
|
1997-02-07 17:24:12 +01:00
|
|
|
|
2001-07-12 06:11:13 +02:00
|
|
|
/* State structure for vac_init_rusage/vac_show_rusage */
|
|
|
|
typedef struct VacRUsage
|
|
|
|
{
|
2001-10-25 07:50:21 +02:00
|
|
|
struct timeval tv;
|
|
|
|
struct rusage ru;
|
2001-07-12 06:11:13 +02:00
|
|
|
} VacRUsage;
|
|
|
|
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
/* in commands/vacuum.c */
|
|
|
|
extern void vacuum(VacuumStmt *vacstmt);
|
2001-07-14 00:55:59 +02:00
|
|
|
extern void vac_open_indexes(Relation relation, int *nindexes,
|
2001-10-25 07:50:21 +02:00
|
|
|
Relation **Irel);
|
2001-07-14 00:55:59 +02:00
|
|
|
extern void vac_close_indexes(int nindexes, Relation *Irel);
|
2001-06-28 01:31:40 +02:00
|
|
|
extern void vac_update_relstats(Oid relid,
|
2001-10-25 07:50:21 +02:00
|
|
|
BlockNumber num_pages,
|
|
|
|
double num_tuples,
|
|
|
|
bool hasindex);
|
2001-08-26 18:56:03 +02:00
|
|
|
extern void vacuum_set_xid_limits(VacuumStmt *vacstmt, bool sharedRel,
|
2001-10-25 07:50:21 +02:00
|
|
|
TransactionId *oldestXmin,
|
|
|
|
TransactionId *freezeLimit);
|
2001-07-18 02:46:25 +02:00
|
|
|
extern bool vac_is_partial_index(Relation indrel);
|
2001-07-12 06:11:13 +02:00
|
|
|
extern void vac_init_rusage(VacRUsage *ru0);
|
|
|
|
extern const char *vac_show_rusage(VacRUsage *ru0);
|
|
|
|
|
2001-07-14 00:55:59 +02:00
|
|
|
/* in commands/vacuumlazy.c */
|
|
|
|
extern void lazy_vacuum_rel(Relation onerel, VacuumStmt *vacstmt);
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
/* in commands/analyze.c */
|
|
|
|
extern void analyze_rel(Oid relid, VacuumStmt *vacstmt);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* VACUUM_H */
|